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

Unified Diff: mojo/system/test_utils.h

Issue 23621056: Initial in-process implementation of some Mojo primitives. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: build fix Created 7 years, 3 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
Index: mojo/system/test_utils.h
diff --git a/mojo/system/test_utils.h b/mojo/system/test_utils.h
new file mode 100644
index 0000000000000000000000000000000000000000..2f1e956e1b0a2f1b7cd821967347f7219fd66cd0
--- /dev/null
+++ b/mojo/system/test_utils.h
@@ -0,0 +1,38 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_SYSTEM_TEST_UTILS_H_
+#define MOJO_SYSTEM_TEST_UTILS_H_
+
+#include "base/basictypes.h"
+#include "base/time/time.h"
+
+namespace mojo {
+namespace system {
+namespace test {
+
+class Stopwatch {
+ public:
+ Stopwatch() {}
+ ~Stopwatch() {}
+
+ void Start() {
+ start_time_ = base::TimeTicks::HighResNow();
+ }
+
+ int64_t Elapsed() {
+ return (base::TimeTicks::HighResNow() - start_time_).InMicroseconds();
+ }
+
+ private:
+ base::TimeTicks start_time_;
+
+ DISALLOW_COPY_AND_ASSIGN(Stopwatch);
+};
+
+} // namespace test
+} // namespace system
+} // namespace mojo
+
+#endif // MOJO_SYSTEM_TEST_UTILS_H_

Powered by Google App Engine
This is Rietveld 408576698