MCPcopy Create free account
hub / github.com/PlatformLab/NanoLog / runTest

Function runTest

runtime/Perf.cc:1338–1352  ·  view source on GitHub ↗

* Runs a particular test and prints a one-line result message. * * \param info * Describes the test to run. */

Source from the content-addressed store, hash-verified

1336 * Describes the test to run.
1337 */
1338void runTest(TestInfo& info)
1339{
1340 double secs = info.func();
1341 int width = printf("%-23s ", info.name);
1342 if (secs < 1.0e-06) {
1343 width += printf("%8.2fns", 1e09*secs);
1344 } else if (secs < 1.0e-03) {
1345 width += printf("%8.2fus", 1e06*secs);
1346 } else if (secs < 1.0) {
1347 width += printf("%8.2fms", 1e03*secs);
1348 } else {
1349 width += printf("%8.2fs", secs);
1350 }
1351 printf("%*s %s\n", 26-width, "", info.description);
1352}
1353
1354int
1355main(int argc, char *argv[])

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected