Gaurav Shah | cc1dd99 | 2010-02-12 11:21:18 -0800 | [diff] [blame] | 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 |
| 3 | * found in the LICENSE file. |
| 4 | */ |
| 5 | |
| 6 | #ifndef VBOOT_REFERENCE_TIMER_UTILS_H_ |
| 7 | #define VBOOT_REFERENCE_TIMER_UTILS_H_ |
| 8 | |
| 9 | #include <inttypes.h> |
vbendeb | 3ecaf77 | 2010-06-24 16:19:53 -0700 | [diff] [blame] | 10 | |
Gaurav Shah | cc1dd99 | 2010-02-12 11:21:18 -0800 | [diff] [blame] | 11 | #include <time.h> |
| 12 | |
| 13 | typedef struct ClockTimer { |
| 14 | struct timespec start_time; |
| 15 | struct timespec end_time; |
| 16 | } ClockTimerState; |
| 17 | |
| 18 | /* Start timer and update [ct]. */ |
| 19 | void StartTimer(ClockTimerState* ct); |
| 20 | |
| 21 | /* Stop timer and update [ct]. */ |
| 22 | void StopTimer(ClockTimerState* ct); |
| 23 | |
| 24 | /* Get duration in milliseconds. */ |
| 25 | uint32_t GetDurationMsecs(ClockTimerState* ct); |
| 26 | |
| 27 | #endif /* VBOOT_REFERENCE_TIMER_UTILS_H_ */ |