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

Unified Diff: webrtc/common_audio/resampler/sinc_resampler_unittest.cc

Issue 1888593004: Delete all use of tick_util.h. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase. Created 4 years, 7 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
Index: webrtc/common_audio/resampler/sinc_resampler_unittest.cc
diff --git a/webrtc/common_audio/resampler/sinc_resampler_unittest.cc b/webrtc/common_audio/resampler/sinc_resampler_unittest.cc
index 42172ebdda7fae7da51d37e50ff9a9e169d5a7da..d3b0dcd428a59c7d551cb8c1436cad535541f971 100644
--- a/webrtc/common_audio/resampler/sinc_resampler_unittest.cc
+++ b/webrtc/common_audio/resampler/sinc_resampler_unittest.cc
@@ -20,11 +20,11 @@
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "webrtc/base/timeutils.h"
#include "webrtc/common_audio/resampler/sinc_resampler.h"
#include "webrtc/common_audio/resampler/sinusoidal_linear_chirp_source.h"
#include "webrtc/system_wrappers/include/cpu_features_wrapper.h"
#include "webrtc/system_wrappers/include/stringize_macros.h"
-#include "webrtc/system_wrappers/include/tick_util.h"
#include "webrtc/test/test_suite.h"
using testing::_;
@@ -107,10 +107,11 @@ TEST(SincResamplerTest, DISABLED_SetRatioBench) {
SincResampler resampler(kSampleRateRatio, SincResampler::kDefaultRequestSize,
&mock_source);
- TickTime start = TickTime::Now();
+ int64_t start = rtc::TimeNanos();
for (int i = 1; i < 10000; ++i)
resampler.SetRatio(1.0 / i);
- double total_time_c_us = (TickTime::Now() - start).Microseconds();
+ double total_time_c_us =
+ (rtc::TimeNanos() - start) / rtc::kNumNanosecsPerMicrosec;
printf("SetRatio() took %.2fms.\n", total_time_c_us / 1000);
}
@@ -179,13 +180,14 @@ TEST(SincResamplerTest, ConvolveBenchmark) {
printf("Benchmarking %d iterations:\n", kConvolveIterations);
// Benchmark Convolve_C().
- TickTime start = TickTime::Now();
+ int64_t start = rtc::TimeNanos();
for (int i = 0; i < kConvolveIterations; ++i) {
resampler.Convolve_C(
resampler.kernel_storage_.get(), resampler.kernel_storage_.get(),
resampler.kernel_storage_.get(), kKernelInterpolationFactor);
}
- double total_time_c_us = (TickTime::Now() - start).Microseconds();
+ double total_time_c_us =
+ (rtc::TimeNanos() - start) / rtc::kNumNanosecsPerMicrosec;
printf("Convolve_C took %.2fms.\n", total_time_c_us / 1000);
#if defined(CONVOLVE_FUNC)
@@ -196,27 +198,27 @@ TEST(SincResamplerTest, ConvolveBenchmark) {
#endif
// Benchmark with unaligned input pointer.
- start = TickTime::Now();
+ start = rtc::TimeNanos();
for (int j = 0; j < kConvolveIterations; ++j) {
resampler.CONVOLVE_FUNC(
resampler.kernel_storage_.get() + 1, resampler.kernel_storage_.get(),
resampler.kernel_storage_.get(), kKernelInterpolationFactor);
}
double total_time_optimized_unaligned_us =
- (TickTime::Now() - start).Microseconds();
+ (rtc::TimeNanos() - start) / rtc::kNumNanosecsPerMicrosec;
printf(STRINGIZE(CONVOLVE_FUNC) "(unaligned) took %.2fms; which is %.2fx "
"faster than Convolve_C.\n", total_time_optimized_unaligned_us / 1000,
total_time_c_us / total_time_optimized_unaligned_us);
// Benchmark with aligned input pointer.
- start = TickTime::Now();
+ start = rtc::TimeNanos();
for (int j = 0; j < kConvolveIterations; ++j) {
resampler.CONVOLVE_FUNC(
resampler.kernel_storage_.get(), resampler.kernel_storage_.get(),
resampler.kernel_storage_.get(), kKernelInterpolationFactor);
}
double total_time_optimized_aligned_us =
- (TickTime::Now() - start).Microseconds();
+ (rtc::TimeNanos() - start) / rtc::kNumNanosecsPerMicrosec;
printf(STRINGIZE(CONVOLVE_FUNC) " (aligned) took %.2fms; which is %.2fx "
"faster than Convolve_C and %.2fx faster than "
STRINGIZE(CONVOLVE_FUNC) " (unaligned).\n",
« no previous file with comments | « webrtc/common_audio/resampler/push_sinc_resampler_unittest.cc ('k') | webrtc/common_video/incoming_video_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698