epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2011 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
mtklein | 9ac68ee | 2014-06-20 11:29:20 -0700 | [diff] [blame] | 7 | #ifndef SysTimer_DEFINED |
| 8 | #define SysTimer_DEFINED |
bungeman@google.com | be9ad4e | 2011-06-07 19:16:02 +0000 | [diff] [blame] | 9 | |
bungeman@google.com | be9ad4e | 2011-06-07 19:16:02 +0000 | [diff] [blame] | 10 | #include <time.h> |
| 11 | |
mtklein | 9ac68ee | 2014-06-20 11:29:20 -0700 | [diff] [blame] | 12 | class SysTimer { |
bungeman@google.com | be9ad4e | 2011-06-07 19:16:02 +0000 | [diff] [blame] | 13 | public: |
| 14 | void startWall(); |
| 15 | void startCpu(); |
| 16 | double endCpu(); |
| 17 | double endWall(); |
| 18 | private: |
| 19 | timespec fCpu; |
| 20 | timespec fWall; |
| 21 | }; |
| 22 | |
| 23 | #endif |