| OLD | NEW |
| 1 | 1 |
| 2 // Copyright 2016 The Chromium Authors. All rights reserved. | 2 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
| 4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
| 5 | 5 |
| 6 #include "platform/Timer.h" | 6 #include "platform/Timer.h" |
| 7 | 7 |
| 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/time/time.h" |
| 8 #include "platform/testing/UnitTestHelpers.h" | 10 #include "platform/testing/UnitTestHelpers.h" |
| 9 #include "public/platform/Platform.h" | 11 #include "public/platform/Platform.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 11 #include "wtf/PtrUtil.h" | 13 #include "wtf/PtrUtil.h" |
| 12 #include "wtf/Vector.h" | 14 #include "wtf/Vector.h" |
| 13 | 15 |
| 14 namespace blink { | 16 namespace blink { |
| 15 | 17 |
| 16 class TimerPerfTest : public ::testing::Test { | 18 class TimerPerfTest : public ::testing::Test { |
| 17 public: | 19 public: |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 double postingTimeUsPerCall = postingTime / static_cast<double>(numIteration
s); | 94 double postingTimeUsPerCall = postingTime / static_cast<double>(numIteration
s); |
| 93 LOG(INFO) << "TimerBase::startOneShot cost (us/call) " << postingTimeUsPerCa
ll << " (total " << postingTime << " us)"; | 95 LOG(INFO) << "TimerBase::startOneShot cost (us/call) " << postingTimeUsPerCa
ll << " (total " << postingTime << " us)"; |
| 94 | 96 |
| 95 double cancelTime = (cancelEnd - cancelStart).InMicroseconds(); | 97 double cancelTime = (cancelEnd - cancelStart).InMicroseconds(); |
| 96 double cancelTimeUsPerCall = cancelTime / static_cast<double>(numIterations)
; | 98 double cancelTimeUsPerCall = cancelTime / static_cast<double>(numIterations)
; |
| 97 LOG(INFO) << "TimerBase::stop cost (us/call) " << cancelTimeUsPerCall << " (
total " << cancelTime << " us)"; | 99 LOG(INFO) << "TimerBase::stop cost (us/call) " << cancelTimeUsPerCall << " (
total " << cancelTime << " us)"; |
| 98 LOG(INFO) << "Time to run " << numIterations << " canceled tasks (us) " << (
m_runEnd - m_runStart).InMicroseconds(); | 100 LOG(INFO) << "Time to run " << numIterations << " canceled tasks (us) " << (
m_runEnd - m_runStart).InMicroseconds(); |
| 99 } | 101 } |
| 100 | 102 |
| 101 } // namespace blink | 103 } // namespace blink |
| OLD | NEW |