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

Method toString

src/openms/source/SYSTEM/StopWatch.cpp:205–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203
204
205 String StopWatch::toString(const double time_in_seconds)
206 {
207 int d(0), h(0), m(0), s(0);
208
209 TimeType time_i = (TimeType)time_in_seconds; // trunc to integer
210
211 // compute days
212 d = int(time_i / (3600*24));
213 time_i -= d*(3600*24);
214
215 // hours
216 h = int(time_i / 3600);
217 time_i -= h*3600;
218
219 // minutes
220 m = int(time_i / 60);
221 time_i -= m*60;
222
223 s = int(time_i);
224
225
226 String s_d = String(d);
227 String s_h = String(h).fillLeft('0', 2) + ":";
228 String s_m = String(m).fillLeft('0', 2) + ":";
229 String s_s = String(s).fillLeft('0', 2); // if we show seconds in combination with minutes, we round to nominal
230
231 return ( (d>0 ? s_d + "d " + s_h + s_m + s_s + " h" :
232 (h>0 ? s_h + s_m + s_s + " h" :
233 (m>0 ? s_m + s_s + " m" :
234 ( String::number(time_in_seconds, 2) + " s"))))); // second (shown by itself with no minutes) has two digits after decimal
235
236 }
237
238 String StopWatch::toString() const
239 {

Callers 15

align_Method · 0.45
getPeptideOccurrence_Method · 0.45
loadAndCleanupIDFile_Method · 0.45
operator<Method · 0.45
postScoreHits_Function · 0.45
operator()Method · 0.45

Calls 7

getClockTimeMethod · 0.95
getCPUTimeMethod · 0.95
getSystemTimeMethod · 0.95
getUserTimeMethod · 0.95
numberFunction · 0.85
toStringFunction · 0.85
StringClass · 0.50

Tested by 15

main_Method · 0.36
updateMembers_Method · 0.36
updateMembers_Method · 0.36
searchSpectrumMethod · 0.36
updateMembers_Method · 0.36
START_SECTIONFunction · 0.36
TEST_EQUALFunction · 0.36
START_SECTIONFunction · 0.36
START_SECTIONFunction · 0.36
START_SECTIONFunction · 0.36
START_SECTIONFunction · 0.36
START_SECTIONFunction · 0.36