OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef GPU_PERFTESTS_MEASUREMENTS_H_ | 5 #ifndef GPU_PERFTESTS_MEASUREMENTS_H_ |
6 #define GPU_PERFTESTS_MEASUREMENTS_H_ | 6 #define GPU_PERFTESTS_MEASUREMENTS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 // The deltas are measured from the time of the object | 40 // The deltas are measured from the time of the object |
41 // creation up to when Record is called. | 41 // creation up to when Record is called. |
42 class MeasurementTimers { | 42 class MeasurementTimers { |
43 public: | 43 public: |
44 explicit MeasurementTimers(gfx::GPUTimingClient* gpu_timing_client); | 44 explicit MeasurementTimers(gfx::GPUTimingClient* gpu_timing_client); |
45 void Record(); | 45 void Record(); |
46 Measurement GetAsMeasurement(const std::string& name); | 46 Measurement GetAsMeasurement(const std::string& name); |
47 ~MeasurementTimers(); | 47 ~MeasurementTimers(); |
48 | 48 |
49 private: | 49 private: |
50 base::TraceTicks wall_time_start_; | 50 base::TimeTicks wall_time_start_; |
51 base::ThreadTicks cpu_time_start_; | 51 base::ThreadTicks cpu_time_start_; |
52 scoped_ptr<gfx::GPUTimer> gpu_timer_; | 52 scoped_ptr<gfx::GPUTimer> gpu_timer_; |
53 | 53 |
54 base::TimeDelta wall_time_; | 54 base::TimeDelta wall_time_; |
55 base::TimeDelta cpu_time_; | 55 base::TimeDelta cpu_time_; |
56 }; | 56 }; |
57 | 57 |
58 } // namespace gpu | 58 } // namespace gpu |
59 | 59 |
60 #endif // GPU_PERFTESTS_MEASUREMENTS_H_ | 60 #endif // GPU_PERFTESTS_MEASUREMENTS_H_ |
OLD | NEW |