44 const char* exceptionCode,
46 const char* comments);
49 # if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE_EXTENDED==1)
50 # define __vfork vfork
55 # include <sys/types.h>
60 if( a == _SC_CLK_TCK )
return 1000;
64 static clock_t filetime2msec( FILETIME* t ){
66 return (clock_t)((((float)t->dwHighDateTime)*429496.7296)+
67 (((float)t->dwLowDateTime)*.0001) );
71 clock_t times(
struct tms * t){
72 FILETIME ct = {0,0}, et = {0,0}, st = {0,0}, ut = {0,0}, rt = {0,0};
75 GetSystemTime( &realtime );
76 SystemTimeToFileTime( &realtime, &rt );
78 GetProcessTimes( GetCurrentProcess(), &ct, &et, &st, &ut);
79 t->tms_utime = t->tms_cutime = filetime2msec(&ut);
80 t->tms_stime = t->tms_cstime = filetime2msec(&st);
82 return filetime2msec(&rt);
97 #ifdef G4MULTITHREADED
103 ss << std::setprecision(1);
104 ss <<
" [Cpu=" << std::setprecision(1) << cpu_util <<
"%]";
110 ss <<
"User=****s Real=****s Sys=****s";
126 G4Exception(
"G4Timer::GetRealElapsed()",
"InvalidCondition",
138 G4Exception(
"G4Timer::GetSystemElapsed()",
"InvalidCondition",
142 return diff/sysconf(_SC_CLK_TCK);
149 G4Exception(
"G4Timer::GetUserElapsed()",
"InvalidCondition",
153 return diff/sysconf(_SC_CLK_TCK);
G4double GetRealElapsed() const
std::vector< ExP01TrackerHit * > a
std::ostream & operator<<(std::ostream &, const BasicVector3D< float > &)
std::chrono::time_point< clock_type > fEndRealTime
G4double GetSystemElapsed() const
G4double GetUserElapsed() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::chrono::time_point< clock_type > fStartRealTime