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

Side by Side Diff: base/rand_util_unittest.cc

Issue 864943002: Replaces instances of the deprecated TimeTicks::HighResNow() with TimeTicks::Now(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More changes based on review comments. Created 5 years, 11 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
« no previous file with comments | « base/message_loop/message_pump_perftest.cc ('k') | base/test/trace_event_analyzer_unittest.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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "base/rand_util.h" 5 #include "base/rand_util.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 // Benchmark test for RandBytes(). Disabled since it's intentionally slow and 127 // Benchmark test for RandBytes(). Disabled since it's intentionally slow and
128 // does not test anything that isn't already tested by the existing RandBytes() 128 // does not test anything that isn't already tested by the existing RandBytes()
129 // tests. 129 // tests.
130 TEST(RandUtilTest, DISABLED_RandBytesPerf) { 130 TEST(RandUtilTest, DISABLED_RandBytesPerf) {
131 // Benchmark the performance of |kTestIterations| of RandBytes() using a 131 // Benchmark the performance of |kTestIterations| of RandBytes() using a
132 // buffer size of |kTestBufferSize|. 132 // buffer size of |kTestBufferSize|.
133 const int kTestIterations = 10; 133 const int kTestIterations = 10;
134 const size_t kTestBufferSize = 1 * 1024 * 1024; 134 const size_t kTestBufferSize = 1 * 1024 * 1024;
135 135
136 scoped_ptr<uint8[]> buffer(new uint8[kTestBufferSize]); 136 scoped_ptr<uint8[]> buffer(new uint8[kTestBufferSize]);
137 const base::TimeTicks now = base::TimeTicks::HighResNow(); 137 const base::TimeTicks now = base::TimeTicks::Now();
138 for (int i = 0; i < kTestIterations; ++i) 138 for (int i = 0; i < kTestIterations; ++i)
139 base::RandBytes(buffer.get(), kTestBufferSize); 139 base::RandBytes(buffer.get(), kTestBufferSize);
140 const base::TimeTicks end = base::TimeTicks::HighResNow(); 140 const base::TimeTicks end = base::TimeTicks::Now();
141 141
142 LOG(INFO) << "RandBytes(" << kTestBufferSize << ") took: " 142 LOG(INFO) << "RandBytes(" << kTestBufferSize << ") took: "
143 << (end - now).InMicroseconds() << "µs"; 143 << (end - now).InMicroseconds() << "µs";
144 } 144 }
OLDNEW
« no previous file with comments | « base/message_loop/message_pump_perftest.cc ('k') | base/test/trace_event_analyzer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698