epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame^] | 1 | |
| 2 | /* |
| 3 | * Copyright 2011 Google Inc. |
| 4 | * |
| 5 | * Use of this source code is governed by a BSD-style license that can be |
| 6 | * found in the LICENSE file. |
| 7 | */ |
bungeman@google.com | be9ad4e | 2011-06-07 19:16:02 +0000 | [diff] [blame] | 8 | #ifndef SkBenchTimer_DEFINED |
| 9 | #define SkBenchTimer_DEFINED |
| 10 | |
| 11 | class BenchSysTimer; |
| 12 | class BenchGpuTimer; |
| 13 | |
| 14 | /** |
| 15 | * SysTimers and GpuTimers are implemented orthogonally. |
| 16 | * This class combines a SysTimer and a GpuTimer into one single, |
| 17 | * platform specific, Timer with a simple interface. |
| 18 | */ |
| 19 | class BenchTimer { |
| 20 | public: |
| 21 | BenchTimer(); |
| 22 | ~BenchTimer(); |
| 23 | void start(); |
| 24 | void end(); |
| 25 | double fCpu; |
| 26 | double fWall; |
| 27 | double fGpu; |
| 28 | |
| 29 | private: |
| 30 | BenchSysTimer *fSysTimer; |
| 31 | BenchGpuTimer *fGpuTimer; |
| 32 | }; |
| 33 | |
| 34 | #endif |