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

Method getSystemTime

src/openms/source/SYSTEM/StopWatch.cpp:180–195  ·  view source on GitHub ↗

system_time reports the current amount of system 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

178 // this is just the accumulated time. If the StopWatch is running, this
179 // is the accumulated time plus the time since the stop_watch was last started
180 double StopWatch::getSystemTime() const
181 {
182 if (is_running_ == false)
183 {
184 /* stop_watch is currently off, so just return accumulated time */
185 return accumulated_times_.kernelTime();
186 }
187
188 /* stop_watch is currently running, so add the elapsed time since */
189 /* the stop_watch was last started to the accumulated time */
190 auto now = snapShot_();
191 auto diff = now - last_start_;
192
193 /* convert into floating point number of seconds */
194 return accumulated_times_.kernelTime() + diff.kernelTime();
195 }
196
197 bool StopWatch::operator==(const StopWatch& rhs) const
198 {

Callers 2

toStringMethod · 0.95
StopWatch_test.cppFile · 0.80

Calls 1

kernelTimeMethod · 0.80

Tested by

no test coverage detected