/*
- * Copyright 2015 Facebook, Inc.
+ * Copyright 2016 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// They key here is accuracy; too low numbers means the accuracy was
// coarse. We up the ante until we get to at least minNanoseconds
// timings.
- static uint64_t resolutionInNs = 0, coarseResolutionInNs = 0;
+ static uint64_t resolutionInNs = 0;
if (!resolutionInNs) {
timespec ts;
CHECK_EQ(0, clock_getres(detail::DEFAULT_CLOCK_ID, &ts));
s.resize(columns - 29, ' ');
auto nsPerIter = get<2>(datum);
auto secPerIter = nsPerIter / 1E9;
- auto itersPerSec = 1 / secPerIter;
+ auto itersPerSec = (secPerIter == 0)
+ ? std::numeric_limits<double>::infinity()
+ : (1 / secPerIter);
if (!useBaseline) {
// Print without baseline
printf("%*s %9s %7s\n",