nanobench: fix and simplify --samplingTime
authormtklein <mtklein@chromium.org>
Wed, 28 Oct 2015 18:36:30 +0000 (11:36 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 28 Oct 2015 18:36:30 +0000 (11:36 -0700)
commitbbba16878f343b232d844281fbdf056c00e20fb6
treefa7ecfa90e63105c2df6ca527e47f9addd59c516
parent87e066ee80e094c8f4ccda3d6c33d907b414b91b
nanobench: fix and simplify --samplingTime

Recent changes to WallTimer broke --samplingTime.  In particular, this idiom became nonsensical:
   WallTimer timer;
   timer.start();
   do {
     ...
     timer.end();
   } while(timer.fWall < ...);

WallTimer started making private use of fWall between when start() and end() were called, so the second time around the loop we end up with nonsense.

If that makes no sense, don't worry.  The code here using now_ms() is just as fast, just as precise, and clearer.

I took the opportunity to simplify --samplingTime <complicated string parsing> to --ms <int>, and to simplify the code that depends on it.

BUG=skia:

Review URL: https://codereview.chromium.org/1419103004
bench/nanobench.cpp