* Runs a particular test and prints a one-line result message. * * \param info * Describes the test to run. */
| 1336 | * Describes the test to run. |
| 1337 | */ |
| 1338 | void 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 | |
| 1354 | int |
| 1355 | main(int argc, char *argv[]) |