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

Unified Diff: mojo/public/c/tests/system/perftest_utils.cc

Issue 2250183003: Make the fuchsia mojo/public repo the source of truth. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/c/tests/system/perftest_utils.h ('k') | mojo/public/c/tests/system/reference_perftest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/c/tests/system/perftest_utils.cc
diff --git a/mojo/public/c/tests/system/perftest_utils.cc b/mojo/public/c/tests/system/perftest_utils.cc
deleted file mode 100644
index e354ae93cf8ccfbe1d39267755dd4cd7dbdf3621..0000000000000000000000000000000000000000
--- a/mojo/public/c/tests/system/perftest_utils.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "mojo/public/c/tests/system/perftest_utils.h"
-
-#include <assert.h>
-#include <mojo/macros.h>
-#include <mojo/system/time.h>
-#include <stddef.h>
-#include <time.h>
-
-#include "mojo/public/cpp/test_support/test_support.h"
-
-namespace mojo {
-namespace test {
-
-// Iterates the given function for |kPerftestTimeMicroseconds| and reports the
-// number of iterations executed per second.
-void IterateAndReportPerf(const char* test_name,
- const char* sub_test_name,
- std::function<void()> single_iteration) {
- // TODO(vtl): These should be specifiable using command-line flags.
- static constexpr size_t kGranularity = 100u;
-
- const MojoTimeTicks start_time = MojoGetTimeTicksNow();
- MojoTimeTicks end_time;
- size_t iterations = 0u;
- do {
- for (size_t i = 0u; i < kGranularity; i++)
- single_iteration();
- iterations += kGranularity;
-
- end_time = MojoGetTimeTicksNow();
- } while (end_time - start_time < kPerftestTimeMicroseconds);
-
- LogPerfResult(test_name, sub_test_name,
- 1000000.0 * iterations / (end_time - start_time),
- "iterations/second");
-}
-
-void Sleep(MojoTimeTicks microseconds) {
- struct timespec req = {
- static_cast<time_t>(microseconds / 1000000), // Seconds.
- static_cast<long>(microseconds % 1000000) * 1000L // Nanoseconds.
- };
- int rv = nanosleep(&req, nullptr);
- MOJO_ALLOW_UNUSED_LOCAL(rv);
- assert(rv == 0);
-}
-
-} // namespace test
-} // namespace mojo
« no previous file with comments | « mojo/public/c/tests/system/perftest_utils.h ('k') | mojo/public/c/tests/system/reference_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698