Problem 2058 - G4Timer does not return valid elapsed (wall clock) time
Summary: G4Timer does not return valid elapsed (wall clock) time
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: global/management (show other problems)
Version: 10.4
Hardware: Apple Mac OS X
: P4 minor
Assignee: Gabriele Cosmo
URL:
Depends on:
Blocks:
 
Reported: 2018-05-04 23:12 CEST by Michael Kelsey
Modified: 2018-05-07 08:24 CEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description Michael Kelsey 2018-05-04 23:12:19 CEST
I am using G4Timer in my application to collect timing information for every run, to use in performance evaluation.  

At begin-run, I call cpuTimer->Start() to initialize the timer, and at end-run I call cpuTimer->Stop(), then extract the three quantities of interest, cpuTimer->GetRealElapsed(), cpuTimer->GetUserElapsed(), cpuTimer->GetSystemElapsed().

The CPU times come out correct, but the elapsed (wall clock) time is wrong.  Every job, no matter how long or short, returns 1.52524e+09.
Comment 1 Gabriele Cosmo 2018-05-07 08:24:49 CEST
The implementation of G4Timer has been recently reviewed to and migrated for real (wall) time to use std::chrono::high_precision_clock from C++11.
It should work correctly now also on MacOS.
Please, try it out in one of the recent reference tags.