43 const char* exceptionCode,
45 const char* comments);
48 # if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE_EXTENDED==1)
49 # define __vfork vfork
54 # include <sys/types.h>
60 if( a == _SC_CLK_TCK )
return 1000;
64 static clock_t filetime2msec( FILETIME*
t )
66 return (clock_t)((((
G4float)t->dwHighDateTime)*429496.7296)+
67 (((
G4float)t->dwLowDateTime)*.0001) );
71 clock_t times(
struct tms * t)
73 FILETIME ct = {0,0}, et = {0,0}, st = {0,0}, ut = {0,0}, rt = {0,0};
76 GetSystemTime( &realtime );
77 SystemTimeToFileTime( &realtime, &rt );
80 GetProcessTimes( GetCurrentProcess(), &ct, &et, &st, &ut);
82 t->tms_utime = t->tms_cutime = filetime2msec(&ut);
83 t->tms_stime = t->tms_cstime = filetime2msec(&st);
85 return filetime2msec(&rt);
101 #ifdef G4MULTITHREADED
107 ss << std::setprecision(1);
108 ss <<
" [Cpu=" << std::setprecision(1) << cpu_util <<
"%]";
114 ss <<
"User=****s Real=****s Sys=****s";
130 G4Exception(
"G4Timer::GetRealElapsed()",
"InvalidCondition",
142 G4Exception(
"G4Timer::GetSystemElapsed()",
"InvalidCondition",
146 return diff/sysconf(_SC_CLK_TCK);
153 G4Exception(
"G4Timer::GetUserElapsed()",
"InvalidCondition",
157 return diff/sysconf(_SC_CLK_TCK);