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

Side by Side 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: C++ wrappers Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef MOJO_SYSTEM_TEST_UTILS_H_
6 #define MOJO_SYSTEM_TEST_UTILS_H_
7
8 #include "base/basictypes.h"
9 #include "base/time/time.h"
10
11 namespace mojo {
12 namespace system {
13 namespace test {
14
15 class Stopwatch {
16 public:
17 Stopwatch() {}
18 ~Stopwatch() {}
19
20 void Start() {
21 start_time_ = base::TimeTicks::HighResNow();
22 }
23
24 int64_t Elapsed() {
25 return (base::TimeTicks::HighResNow() - start_time_).InMicroseconds();
26 }
27
28 private:
29 base::TimeTicks start_time_;
30
31 DISALLOW_COPY_AND_ASSIGN(Stopwatch);
32 };
33
34 } // namespace test
35 } // namespace system
36 } // namespace mojo
37
38 #endif // MOJO_SYSTEM_TEST_UTILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698