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

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

Issue 23985006: base: Split logging functions and PerfTimeLogger out of perftimer.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix visitedlink 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/test/perf_time_logger.h ('k') | base/test/perftimer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "base/test/perf_time_logger.h"
6
7 #include "base/test/perf_log.h"
8
9 namespace base {
10
11 PerfTimeLogger::PerfTimeLogger(const char* test_name)
12 : logged_(false), test_name_(test_name) {}
13
14 PerfTimeLogger::~PerfTimeLogger() {
15 if (!logged_)
16 Done();
17 }
18
19 void PerfTimeLogger::Done() {
20 // we use a floating-point millisecond value because it is more
21 // intuitive than microseconds and we want more precision than
22 // integer milliseconds
23 LogPerfResult(test_name_.c_str(), timer_.Elapsed().InMillisecondsF(), "ms");
24 logged_ = true;
25 }
26
27 } // namespace base
OLDNEW
« no previous file with comments | « base/test/perf_time_logger.h ('k') | base/test/perftimer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698