Revert of Add nanosecond timer. (https://codereview.chromium.org/250243002/)
Reason for revert:
breaks EVERYTHING
Original issue's description:
> Add nanosecond timer.
>
> I've been finding it hard to get enough resolution out of our existing timers when measuring really tiny pictures.
>
> BUG=skia:2378
>
> Committed: http://code.google.com/p/skia/source/detail?r=14362
R=bsalomon@google.com, bungeman@google.com, mtklein@chromium.org
TBR=bsalomon@google.com, bungeman@google.com, mtklein@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:2378
Author: mtklein@google.com
Review URL: https://codereview.chromium.org/258703002
git-svn-id: http://skia.googlecode.com/svn/trunk@14364 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tools/bench_playback.cpp b/tools/bench_playback.cpp
index 534ad96..a5dfe50 100644
--- a/tools/bench_playback.cpp
+++ b/tools/bench_playback.cpp
@@ -40,7 +40,7 @@
src.width() * sizeof(SkPMColor)));
canvas->clipRect(SkRect::MakeWH(SkIntToScalar(FLAGS_tile), SkIntToScalar(FLAGS_tile)));
- const SkNSec start = SkTime::GetNSecs();
+ const SkMSec start = SkTime::GetMSecs();
for (int i = 0; i < FLAGS_loops; i++) {
if (FLAGS_skr) {
SkRecordDraw(record, canvas.get());
@@ -49,9 +49,9 @@
}
}
- const SkNSec elapsed = SkTime::GetNSecs() - start;
- const double nsPerLoop = elapsed / (double)FLAGS_loops;
- printf("%u\t%s\n", SkToUInt(nsPerLoop), name);
+ const SkMSec elapsed = SkTime::GetMSecs() - start;
+ const double msPerLoop = elapsed / (double)FLAGS_loops;
+ printf("%6.2f\t%s\n", msPerLoop, name);
}
int tool_main(int argc, char** argv);
diff --git a/tools/bench_record.cpp b/tools/bench_record.cpp
index 712f63a..63139d6 100644
--- a/tools/bench_record.cpp
+++ b/tools/bench_record.cpp
@@ -56,7 +56,7 @@
}
static void bench_record(SkPicture* src, const char* name, SkBBHFactory* bbhFactory) {
- const SkNSec start = SkTime::GetNSecs();
+ const SkMSec start = SkTime::GetMSecs();
const int width = src ? src->width() : FLAGS_nullSize;
const int height = src ? src->height() : FLAGS_nullSize;
@@ -80,9 +80,9 @@
}
}
- const SkNSec elapsed = SkTime::GetNSecs() - start;
- const double nsPerLoop = elapsed / (double)FLAGS_loops;
- printf("%u\t%s\n", SkToUInt(nsPerLoop), name);
+ const SkMSec elapsed = SkTime::GetMSecs() - start;
+ const double msPerLoop = elapsed / (double)FLAGS_loops;
+ printf("%.2g\t%s\n", msPerLoop, name);
}
int tool_main(int argc, char** argv);