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

Side by Side Diff: base/test/perf_time_logger.h

Issue 1544113002: Switch to standard integer types in base/test/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « base/test/perf_test_suite.cc ('k') | base/test/run_all_unittests.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_TEST_PERF_TIME_LOGGER_H_ 5 #ifndef BASE_TEST_PERF_TIME_LOGGER_H_
6 #define BASE_TEST_PERF_TIME_LOGGER_H_ 6 #define BASE_TEST_PERF_TIME_LOGGER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/macros.h"
11 #include "base/timer/elapsed_timer.h" 11 #include "base/timer/elapsed_timer.h"
12 12
13 namespace base { 13 namespace base {
14 14
15 // Automates calling LogPerfResult for the common case where you want 15 // Automates calling LogPerfResult for the common case where you want
16 // to measure the time that something took. Call Done() when the test 16 // to measure the time that something took. Call Done() when the test
17 // is complete if you do extra work after the test or there are stack 17 // is complete if you do extra work after the test or there are stack
18 // objects with potentially expensive constructors. Otherwise, this 18 // objects with potentially expensive constructors. Otherwise, this
19 // class with automatically log on destruction. 19 // class with automatically log on destruction.
20 class PerfTimeLogger { 20 class PerfTimeLogger {
21 public: 21 public:
22 explicit PerfTimeLogger(const char* test_name); 22 explicit PerfTimeLogger(const char* test_name);
23 ~PerfTimeLogger(); 23 ~PerfTimeLogger();
24 24
25 void Done(); 25 void Done();
26 26
27 private: 27 private:
28 bool logged_; 28 bool logged_;
29 std::string test_name_; 29 std::string test_name_;
30 ElapsedTimer timer_; 30 ElapsedTimer timer_;
31 31
32 DISALLOW_COPY_AND_ASSIGN(PerfTimeLogger); 32 DISALLOW_COPY_AND_ASSIGN(PerfTimeLogger);
33 }; 33 };
34 34
35 } // namespace base 35 } // namespace base
36 36
37 #endif // BASE_TEST_PERF_TIME_LOGGER_H_ 37 #endif // BASE_TEST_PERF_TIME_LOGGER_H_
OLDNEW
« no previous file with comments | « base/test/perf_test_suite.cc ('k') | base/test/run_all_unittests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698