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

Unified Diff: mojo/edk/util/ref_counted_perftest.cc

Issue 1408003013: Reland "EDK: Move //mojo/edk/system/waitable_event* to edk/util." (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « mojo/edk/util/mutex_unittest.cc ('k') | mojo/edk/util/waitable_event.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/util/ref_counted_perftest.cc
diff --git a/mojo/edk/util/ref_counted_perftest.cc b/mojo/edk/util/ref_counted_perftest.cc
index 3c270e5787a2f60e3f034f66839f206f4486edd0..e1b6de56a021eb79fc42775ced46b8b5e0a4ce30 100644
--- a/mojo/edk/util/ref_counted_perftest.cc
+++ b/mojo/edk/util/ref_counted_perftest.cc
@@ -10,6 +10,10 @@
#include "mojo/edk/util/ref_counted.h"
#include "testing/gtest/include/gtest/gtest.h"
+using mojo::system::test::DeadlineFromMilliseconds;
+using mojo::system::test::LogPerfResult;
+using mojo::system::test::Stopwatch;
+
namespace mojo {
namespace util {
namespace {
@@ -29,7 +33,7 @@ class MyClass : public RefCountedThreadSafe<MyClass> {
TEST(RefCountedPerfTest, OneThreadCreateAdoptDestroy) {
uint64_t iterations = 0;
- system::test::Stopwatch stopwatch;
+ Stopwatch stopwatch;
stopwatch.Start();
do {
for (size_t i = 0; i < 1000; i++, iterations++) {
@@ -37,28 +41,27 @@ TEST(RefCountedPerfTest, OneThreadCreateAdoptDestroy) {
x = nullptr;
}
iterations++;
- } while (stopwatch.Elapsed() < system::test::DeadlineFromMilliseconds(1000));
+ } while (stopwatch.Elapsed() < DeadlineFromMilliseconds(1000));
double elapsed = stopwatch.Elapsed() / 1000000.0;
- system::test::LogPerfResult("OneThreadCreateAdoptDestroy",
- iterations / elapsed, "iterations/s");
+ LogPerfResult("OneThreadCreateAdoptDestroy", iterations / elapsed,
+ "iterations/s");
}
TEST(RefCountedPerfTest, OneThreadAssignRefPtr) {
RefPtr<MyClass> x = MyClass::Create();
uint64_t iterations = 0;
- system::test::Stopwatch stopwatch;
+ Stopwatch stopwatch;
stopwatch.Start();
do {
for (size_t i = 0; i < 1000; i++, iterations++) {
RefPtr<MyClass> y = x;
}
iterations++;
- } while (stopwatch.Elapsed() < system::test::DeadlineFromMilliseconds(1000));
+ } while (stopwatch.Elapsed() < DeadlineFromMilliseconds(1000));
double elapsed = stopwatch.Elapsed() / 1000000.0;
- system::test::LogPerfResult("OneThreadAssignRefPtr", iterations / elapsed,
- "iterations/s");
+ LogPerfResult("OneThreadAssignRefPtr", iterations / elapsed, "iterations/s");
}
// TODO(vtl): Add threaded perf tests.
« no previous file with comments | « mojo/edk/util/mutex_unittest.cc ('k') | mojo/edk/util/waitable_event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698