blob: f0d6b29973df1cb890fc8f956b2f02c0f1bcae46 [file] [log] [blame]
Gaurav Shahcc1dd992010-02-12 11:21:18 -08001/* 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
vbendeb3ecaf772010-06-24 16:19:53 -07009#ifndef _MSC_VER
Gaurav Shahcc1dd992010-02-12 11:21:18 -080010#include <inttypes.h>
vbendeb3ecaf772010-06-24 16:19:53 -070011#endif
12
Gaurav Shahcc1dd992010-02-12 11:21:18 -080013#include <time.h>
14
15typedef struct ClockTimer {
16 struct timespec start_time;
17 struct timespec end_time;
18} ClockTimerState;
19
20/* Start timer and update [ct]. */
21void StartTimer(ClockTimerState* ct);
22
23/* Stop timer and update [ct]. */
24void StopTimer(ClockTimerState* ct);
25
26/* Get duration in milliseconds. */
27uint32_t GetDurationMsecs(ClockTimerState* ct);
28
29#endif /* VBOOT_REFERENCE_TIMER_UTILS_H_ */