34#if defined(_WIN32) || defined(_WIN64)
59#if defined(_WIN32) || defined(_WIN64)
82 return (SCIP_Real)sec + 0.000001 * (
SCIP_Real)usec;
96#if defined(_WIN32) || defined(_WIN64)
134 if(
clck->clocktype != newtype )
139 clck->clocktype = newtype;
148 clck->clocktype = newtype;
204 clck->lasttime = 0.0;
216 switch(
clck->clocktype )
221 clck->data.cpuclock.user = 0;
224 clck->data.wallclock.sec = 0;
225 clck->data.wallclock.usec = 0;
281 SCIPdebugMessage(
"setting type of clock %p (type %d, usedefault=%u) to %d\n",
282 (
void*)
clck,
clck->clocktype,
clck->usedefault, clocktype);
284 clck->clocktype = clocktype;
298 if(
set->time_enabled &&
clck->enabled )
302 if(
clck->nruns == 0 )
304#if defined(_WIN32) || defined(_WIN64)
316 switch(
clck->clocktype )
319#if defined(_WIN32) || defined(_WIN64)
324 clck->data.cpuclock.user -=
now.tms_utime;
330#if defined(_WIN32) || defined(_WIN64)
331 clck->data.wallclock.sec -= time(
NULL);
334 if(
tp.tv_usec >
clck->data.wallclock.usec )
336 clck->data.wallclock.sec -= (
tp.tv_sec + 1);
337 clck->data.wallclock.usec += (1000000 -
tp.tv_usec);
341 clck->data.wallclock.sec -=
tp.tv_sec;
342 clck->data.wallclock.usec -=
tp.tv_usec;
368 if(
set->time_enabled &&
clck->enabled )
373 if(
clck->nruns == 0 )
375#if defined(_WIN32) || defined(_WIN64)
387 switch(
clck->clocktype )
390#if defined(_WIN32) || defined(_WIN64)
395 clck->data.cpuclock.user +=
now.tms_utime;
400#if defined(_WIN32) || defined(_WIN64)
401 clck->data.wallclock.sec += time(
NULL);
404 if(
tp.tv_usec +
clck->data.wallclock.usec > 1000000 )
406 clck->data.wallclock.sec += (
tp.tv_sec + 1);
407 clck->data.wallclock.usec -= (1000000 -
tp.tv_usec);
411 clck->data.wallclock.sec +=
tp.tv_sec;
412 clck->data.wallclock.usec +=
tp.tv_usec;
433 return (
clck->nruns > 0);
446 SCIPdebugMessage(
"getting time of clock %p (type %d, usedefault=%u, nruns=%d)\n",
453 else if(
clck->nruns == 0 )
456 switch(
clck->clocktype )
474#if defined(_WIN32) || defined(_WIN64)
485 switch(
clck->clocktype )
488#if defined(_WIN32) || defined(_WIN64)
497#if defined(_WIN32) || defined(_WIN64)
501 if(
tp.tv_usec +
clck->data.wallclock.usec > 1000000 )
503 (
clck->data.wallclock.usec - 1000000) +
tp.tv_usec);
506 clck->data.wallclock.usec +
tp.tv_usec);
535 return clck->lasttime;
546 SCIPdebugMessage(
"setting time of clock %p (type %d, usedefault=%u, nruns=%d) to %g\n",
553 switch(
clck->clocktype )
569 if(
clck->nruns >= 1 )
571#if defined(_WIN32) || defined(_WIN64)
582 switch(
clck->clocktype )
585#if defined(_WIN32) || defined(_WIN64)
590 clck->data.cpuclock.user -=
now.tms_utime;
595#if defined(_WIN32) || defined(_WIN64)
596 clck->data.wallclock.sec -= time(
NULL);
599 if(
tp.tv_usec >
clck->data.wallclock.usec )
601 clck->data.wallclock.sec -= (
tp.tv_sec + 1);
602 clck->data.wallclock.usec += (1000000 -
tp.tv_usec);
606 clck->data.wallclock.sec -=
tp.tv_sec;
607 clck->data.wallclock.usec -=
tp.tv_usec;
625#if defined(_WIN32) || defined(_WIN64)
628 return (SCIP_Real)(
now % (24*3600));
634 return (SCIP_Real)(
tp.tv_sec % (24*3600)) + (
SCIP_Real)
tp.tv_usec / 1
e+6;
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
assert(minobj< SCIPgetCutoffbound(scip))
memory allocation routines
#define BMSfreeMemory(ptr)
#define BMSallocMemory(ptr)
public methods for message output
internal methods for global SCIP settings
datastructures for clocks and timing issues
enum SCIP_ClockType SCIP_CLOCKTYPE
enum SCIP_Retcode SCIP_RETCODE