Problem 2058

Summary: G4Timer does not return valid elapsed (wall clock) time
Product: Geant4 Reporter: Michael Kelsey <kelsey>
Component: global/managementAssignee: Gabriele Cosmo <Gabriele.Cosmo>
Status: RESOLVED FIXED    
Severity: minor    
Priority: P4    
Version: 10.4   
Hardware: Apple   
OS: Mac OS X   

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.