Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Unified Diff: tests/Test.h

Issue 1811613004: Change SkTime::GetMSecs to double; ensure values stored in SkMSec do not overflow. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Rebase. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/StrokerTest.cpp ('k') | tests/Test.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/Test.h
diff --git a/tests/Test.h b/tests/Test.h
index d643c8382a168068412043f752ccb802c1c5d44c..411ce11c20273962e5380687007354c58c39a326 100644
--- a/tests/Test.h
+++ b/tests/Test.h
@@ -85,6 +85,27 @@ enum GPUTestContexts {
template<typename T>
void RunWithGPUTestContexts(T testFunction, GPUTestContexts contexts, Reporter* reporter,
GrContextFactory* factory);
+
+/** Timer provides wall-clock duration since its creation. */
+class Timer {
+public:
+ /** Starts the timer. */
+ Timer();
+
+ /** Nanoseconds since creation. */
+ double elapsedNs() const;
+
+ /** Milliseconds since creation. */
+ double elapsedMs() const;
+
+ /** Milliseconds since creation as an integer.
+ Behavior is undefined for durations longer than SK_MSecMax.
+ */
+ SkMSec elapsedMsInt() const;
+private:
+ double fStartNanos;
+};
+
} // namespace skiatest
#define REPORTER_ASSERT(r, cond) \
« no previous file with comments | « tests/StrokerTest.cpp ('k') | tests/Test.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698