39void G4Exception(
const char* originOfException,
const char* exceptionCode,
43# if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE_EXTENDED == 1)
49# include <sys/types.h>
61static clock_t filetime2msec(FILETIME* t)
63 return (clock_t)((((
G4float) t->dwHighDateTime) * 429496.7296) +
64 (((
G4float) t->dwLowDateTime) * .0001));
67clock_t times(
struct tms* t)
69 FILETIME ct = { 0, 0 }, et = { 0, 0 }, st = { 0, 0 }, ut = { 0, 0 },
73 GetSystemTime(&realtime);
74 SystemTimeToFileTime(&realtime, &rt);
77 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);
103 ss << std::setprecision(1);
104 ss <<
" [Cpu=" << std::setprecision(1) << cpu_util <<
"%]";
110 ss <<
"User=****s Real=****s Sys=****s";
126 "Timer not stopped or times not recorded!");
136 G4Exception(
"G4Timer::GetSystemElapsed()",
"InvalidCondition",
140 return diff / sysconf(_SC_CLK_TCK);
148 "Timer not stopped or times not recorded");
151 return diff / sysconf(_SC_CLK_TCK);
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
std::chrono::time_point< clock_type > fStartRealTime
G4double GetSystemElapsed() const
std::chrono::time_point< clock_type > fEndRealTime
G4double GetUserElapsed() const
G4double GetRealElapsed() const
std::ostream & operator<<(std::ostream &, const BasicVector3D< float > &)