OLD | NEW |
1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 /* Copyright (c) 2010 The Chromium OS 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 | 5 |
6 #ifndef VBOOT_REFERENCE_TIMER_UTILS_H_ | 6 #ifndef VBOOT_REFERENCE_TIMER_UTILS_H_ |
7 #define VBOOT_REFERENCE_TIMER_UTILS_H_ | 7 #define VBOOT_REFERENCE_TIMER_UTILS_H_ |
8 | 8 |
| 9 #ifndef _MSC_VER |
9 #include <inttypes.h> | 10 #include <inttypes.h> |
| 11 #endif |
| 12 |
10 #include <time.h> | 13 #include <time.h> |
11 | 14 |
12 typedef struct ClockTimer { | 15 typedef struct ClockTimer { |
13 struct timespec start_time; | 16 struct timespec start_time; |
14 struct timespec end_time; | 17 struct timespec end_time; |
15 } ClockTimerState; | 18 } ClockTimerState; |
16 | 19 |
17 /* Start timer and update [ct]. */ | 20 /* Start timer and update [ct]. */ |
18 void StartTimer(ClockTimerState* ct); | 21 void StartTimer(ClockTimerState* ct); |
19 | 22 |
20 /* Stop timer and update [ct]. */ | 23 /* Stop timer and update [ct]. */ |
21 void StopTimer(ClockTimerState* ct); | 24 void StopTimer(ClockTimerState* ct); |
22 | 25 |
23 /* Get duration in milliseconds. */ | 26 /* Get duration in milliseconds. */ |
24 uint32_t GetDurationMsecs(ClockTimerState* ct); | 27 uint32_t GetDurationMsecs(ClockTimerState* ct); |
25 | 28 |
26 #endif /* VBOOT_REFERENCE_TIMER_UTILS_H_ */ | 29 #endif /* VBOOT_REFERENCE_TIMER_UTILS_H_ */ |
OLD | NEW |