MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / getUserTime

Method getUserTime

src/openms/source/SYSTEM/StopWatch.cpp:159–174  ·  view source on GitHub ↗

getUserTime reports the current amount of user cpu time accumulated by this StopWatch. If the stop_watch is currently off, this is just the accumulated time. If the StopWatch is running, this is the accumulated time plus the time since the stop_watch was last started.

Source from the content-addressed store, hash-verified

157 //this is just the accumulated time. If the StopWatch is running, this
158 //is the accumulated time plus the time since the stop_watch was last started.
159 double StopWatch::getUserTime() const
160 {
161 if (is_running_ == false)
162 {
163 /* stop_watch is currently off, so just return accumulated time */
164 return accumulated_times_.userTime();
165 }
166
167 /* stop_watch is currently running, so add the elapsed time since */
168 /* the stop_watch was last started to the accumulated time */
169 auto now = snapShot_();
170 auto diff = now - last_start_;
171
172 /* convert into floating point number of seconds */
173 return accumulated_times_.userTime() + diff.userTime();
174 }
175
176 // system_time reports the current amount of system cpu time
177 // accumulated by this StopWatch. If the stop_watch is currently off,

Callers 2

toStringMethod · 0.95
StopWatch_test.cppFile · 0.80

Calls 1

userTimeMethod · 0.80

Tested by

no test coverage detected