Changeset 507


Ignore:
Timestamp:
Feb 15, 2011 3:53:18 PM (9 years ago)
Author:
pbelotti
Message:

making misc_utils in sdpcuts/ independent of rusage

Location:
trunk/Couenne/src/sdpcuts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Couenne/src/sdpcuts/misc_util.cpp

    r487 r507  
     1/* $Id$
     2 *
     3 * Name:    misc_util.cpp
     4 * Author:  Andrea Qualizza
     5 * Purpose: utilities for sdpcuts
     6 *
     7 * This file is licensed under the Eclipse Public License (EPL)
     8 */
     9
    110#include <cstdio>
    211#include <math.h>
    3 #include <sys/time.h>
    4 #include <sys/resource.h>
     12#include "CoinTime.hpp"
    513
    614#include "misc_util.hpp"
     
    8391Timer::~Timer() { if (_pause) delete _pausetimer; }
    8492void Timer::start() {
    85         getrusage (RUSAGE_SELF, &_use);
    86         _starttime = _use.ru_utime.tv_sec + 1e-6 * _use.ru_utime.tv_usec;
     93  _starttime = CoinCpuTime ();
     94  //    getrusage (RUSAGE_SELF, &_use);
     95  //    _starttime = _use.ru_utime.tv_sec + 1e-6 * _use.ru_utime.tv_usec;
    8796}
    8897
     
    93102                return fabs( _pausetimer->starttime() - _starttime );
    94103        }
    95         getrusage (RUSAGE_SELF, &_use);
    96                 return fabs( (_use.ru_utime.tv_sec + 1e-6 * _use.ru_utime.tv_usec) - _starttime );
     104        //      getrusage (RUSAGE_SELF, &_use);
     105        //      return fabs( (_use.ru_utime.tv_sec + 1e-6 * _use.ru_utime.tv_usec) - _starttime );
     106        return (fabs (CoinCpuTime () - _starttime));
    97107}
    98108
  • trunk/Couenne/src/sdpcuts/misc_util.hpp

    r487 r507  
     1/* $Id$
     2 *
     3 * Name:    misc_util.hpp
     4 * Author:  Andrea Qualizza
     5 * Purpose: utilities for sdpcuts
     6 *
     7 * This file is licensed under the Eclipse Public License (EPL)
     8 */
     9
    110#ifndef MISCUTIL_HPP
    211#define MISCUTIL_HPP
     
    413#include <stdio.h>
    514#include <stdlib.h>
    6 #include <sys/resource.h>
    715#include "OsiXxxSolverInterface.hpp"
    816#include "OsiSolverInterface.hpp"
     
    4957                double _starttime;
    5058                Timer *_pausetimer;
    51                 struct rusage _use;
    5259                bool _pause;
    5360                double starttime();
Note: See TracChangeset for help on using the changeset viewer.