clock_t clocks_per_second;
59#if defined(_WIN32) || defined(_WIN64) 60clocks_per_second = 100;
63clocks_per_second = sysconf(_SC_CLK_TCK);
65clocks_per_second = CLK_TCK;
92clock_t clocks_per_second;
94assert(cputime !=
NULL);
96#if defined(_WIN32) || defined(_WIN64) 97clocks_per_second = 100;
100clocks_per_second = sysconf(_SC_CLK_TCK);
102clocks_per_second = CLK_TCK;
105*cputime = (clock_t)(sec * clocks_per_second);
116assert(wallsec !=
NULL);
117assert(wallusec !=
NULL);
119*wallsec = (long)sec;
120*wallusec = (long)((sec - *wallsec) * 1000000.0);
131assert(clck !=
NULL);
138assert(clck->
nruns== 0);
162assert(clck !=
NULL);
175assert(clck !=
NULL);
189assert(clck !=
NULL);
200assert(clck !=
NULL);
202 SCIPdebugMessage(
"initializing clock %p of type %d\n", (
void*)clck, clocktype);
213assert(clck !=
NULL);
239assert(clck !=
NULL);
251assert(clck !=
NULL);
265assert(clck !=
NULL);
279assert(clck !=
NULL);
281 SCIPdebugMessage(
"setting type of clock %p (type %d, usedefault=%u) to %d\n",
295assert(clck !=
NULL);
302 if( clck->
nruns== 0 )
304#if defined(_WIN32) || defined(_WIN64) 305FILETIME creationtime;
316 switch( clck->clocktype )
319#if defined(_WIN32) || defined(_WIN64) 320GetProcessTimes(GetCurrentProcess(), &creationtime, &exittime, &kerneltime, &usertime);
321clck->data.cpuclock.user -= usertime.dwHighDateTime * 42950 + usertime.dwLowDateTime / 100000L;
324clck->data.cpuclock.user -= now.tms_utime;
326clck->lasttime =
cputime2sec(clck->data.cpuclock.user);
330#if defined(_WIN32) || defined(_WIN64) 331clck->data.wallclock.sec -= time(
NULL);
333gettimeofday(&tp,
NULL);
334 if( tp.tv_usec > clck->data.wallclock.usec )
336clck->data.wallclock.sec -= (tp.tv_sec + 1);
337clck->data.wallclock.usec += (1000000 - tp.tv_usec);
341clck->data.wallclock.sec -= tp.tv_sec;
342clck->data.wallclock.usec -= tp.tv_usec;
345clck->lasttime =
walltime2sec(clck->data.wallclock.sec, clck->data.wallclock.usec);
365assert(clck !=
NULL);
370assert(clck->
nruns>= 1);
373 if( clck->
nruns== 0 )
375#if defined(_WIN32) || defined(_WIN64) 376FILETIME creationtime;
387 switch( clck->clocktype )
390#if defined(_WIN32) || defined(_WIN64) 391GetProcessTimes(GetCurrentProcess(), &creationtime, &exittime, &kerneltime, &usertime);
392clck->data.cpuclock.user += usertime.dwHighDateTime * 42950 + usertime.dwLowDateTime / 100000L;
395clck->data.cpuclock.user += now.tms_utime;
400#if defined(_WIN32) || defined(_WIN64) 401clck->data.wallclock.sec += time(
NULL);
403gettimeofday(&tp,
NULL);
404 if( tp.tv_usec + clck->data.wallclock.usec > 1000000 )
406clck->data.wallclock.sec += (tp.tv_sec + 1);
407clck->data.wallclock.usec -= (1000000 - tp.tv_usec);
411clck->data.wallclock.sec += tp.tv_sec;
412clck->data.wallclock.usec += tp.tv_usec;
431assert(clck !=
NULL);
433 return(clck->
nruns> 0);
443assert(clck !=
NULL);
446 SCIPdebugMessage(
"getting time of clock %p (type %d, usedefault=%u, nruns=%d)\n",
453 else if( clck->
nruns== 0 )
474#if defined(_WIN32) || defined(_WIN64) 475FILETIME creationtime;
488#if defined(_WIN32) || defined(_WIN64) 489GetProcessTimes(GetCurrentProcess(), &creationtime, &exittime, &kerneltime, &usertime);
497#if defined(_WIN32) || defined(_WIN64) 500gettimeofday(&tp,
NULL);
520assert(!
EPSN(result, 1e-12));
533assert(clck !=
NULL);
544assert(clck !=
NULL);
546 SCIPdebugMessage(
"setting time of clock %p (type %d, usedefault=%u, nruns=%d) to %g\n",
569 if( clck->
nruns>= 1 )
571#if defined(_WIN32) || defined(_WIN64) 572FILETIME creationtime;
585#if defined(_WIN32) || defined(_WIN64) 586GetProcessTimes(GetCurrentProcess(), &creationtime, &exittime, &kerneltime, &usertime);
587clck->
data.
cpuclock.
user-= usertime.dwHighDateTime * 42950 + usertime.dwLowDateTime / 100000L;
595#if defined(_WIN32) || defined(_WIN64) 598gettimeofday(&tp,
NULL);
625#if defined(_WIN32) || defined(_WIN64) 632gettimeofday(&tp,
NULL);
void SCIPclockEnable(SCIP_CLOCK *clck)
void SCIPclockSetTime(SCIP_CLOCK *clck, SCIP_Real sec)
SCIP_Real SCIPclockGetTimeOfDay(void)
void SCIPclockDisable(SCIP_CLOCK *clck)
static void sec2walltime(SCIP_Real sec, long *wallsec, long *wallusec)
static void clockUpdateDefaultType(SCIP_CLOCK *clck, SCIP_CLOCKTYPE defaultclocktype)
void SCIPclockSetType(SCIP_CLOCK *clck, SCIP_CLOCKTYPE clocktype)
void SCIPclockStop(SCIP_CLOCK *clck, SCIP_SET *set)
SCIP_Bool SCIPclockIsRunning(SCIP_CLOCK *clck)
static SCIP_Real walltime2sec(long sec, long usec)
void SCIPclockEnableOrDisable(SCIP_CLOCK *clck, SCIP_Bool enable)
void SCIPclockStart(SCIP_CLOCK *clck, SCIP_SET *set)
SCIP_Real SCIPclockGetLastTime(SCIP_CLOCK *clck)
SCIP_Real SCIPclockGetTime(SCIP_CLOCK *clck)
static void clockSetType(SCIP_CLOCK *clck, SCIP_CLOCKTYPE newtype)
void SCIPclockReset(SCIP_CLOCK *clck)
void SCIPclockInit(SCIP_CLOCK *clck, SCIP_CLOCKTYPE clocktype)
void SCIPclockFree(SCIP_CLOCK **clck)
static SCIP_Real cputime2sec(clock_t cputime)
SCIP_RETCODE SCIPclockCreate(SCIP_CLOCK **clck, SCIP_CLOCKTYPE clocktype)
static void sec2cputime(SCIP_Real sec, clock_t *cputime)
internal methods for clocks and timing issues
common defines and data types used in all packages of SCIP
memory allocation routines
#define BMSfreeMemory(ptr)
#define BMSallocMemory(ptr)
public methods for message output
internal methods for global SCIP settings
union SCIP_Clock::@15 data
datastructures for clocks and timing issues
enum SCIP_ClockType SCIP_CLOCKTYPE
enum SCIP_Retcode SCIP_RETCODE
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4