MCPcopy Create free account
hub / github.com/Gecode/gecode / stop

Function stop

gecode/driver/script.cpp:41–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39namespace Gecode { namespace Driver {
40
41 void
42 stop(Support::Timer& timer, std::ostream& os) {
43 double t = timer.stop();
44 unsigned int sec = static_cast<unsigned int>(floor(t / 1000.0));
45 unsigned int o_msec = static_cast<unsigned int>
46 (t - 1000.0*static_cast<double>(sec));
47 unsigned int min = sec / 60;
48 unsigned int o_sec = sec - 60 * min;
49 unsigned int hour = min / 60;
50 unsigned int o_min = min - 60 * hour;
51 unsigned int day = hour / 24;
52 unsigned int o_hour = hour - 24 * day;
53 if (day)
54 os << day << " days, ";
55 if (o_hour)
56 os << o_hour << ":";
57 if (o_hour || o_min) {
58 if (o_hour) {
59 os.width(2); os.fill('0');
60 }
61 os << o_min << ":";
62 os.width(2); os.fill('0');
63 }
64 os << o_sec << ".";
65 os.width(3); os.fill('0');
66 os << o_msec
67 << " ("
68 << std::showpoint << std::fixed
69 << std::setprecision(3) << t << " ms)";
70 }
71
72
73 double

Callers 8

nextMethod · 0.85
solveFunction · 0.85
nextMethod · 0.85
nextMethod · 0.85
nextMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMetaMethod · 0.85

Calls 3

stopMethod · 0.45
widthMethod · 0.45
fillMethod · 0.45

Tested by

no test coverage detected