- Main Page
- Data Structures
- Files
- Related Pages

- File List
- Globals

# timerutil.h File Reference

## Detailed Description

Version:
  00.10

This interface enables easy benchmarking on Linux. It returns microseconds as unit, but does not in any way guarantee this precision in the resulting numbers.

The maximum timespan measurable (delta or total) depends on the number of bits of an unsigned long on your system (X), and is 2^X us. With 32-bit unsigned longs this means 2^32 us which is almost 72 minutes.

     * ============================================================================
     * Copyright (c) Texas Instruments Inc 2005
     *
     * Use of this software is controlled by the terms and conditions found in the
     * license agreement under which this software has been supplied or provided.
     * ============================================================================
     *

`#include <sys/time.h>`

Include dependency graph for timerutil.h:

Go to the source code of this file.

## Data Structures
struct | TimerUtilObjStruct
| Object that stores the state of the timer. Needs to be declared by the application and passed to the timerutil API calls. More...
## Typedefs
typedef TimerUtilObjStruct | TimerUtilObj
| Object that stores the state of the timer. Needs to be declared by the application and passed to the timerutil API calls.
typedef TimerUtilObj * | TimerUtilHandle
| Pointer to a timer state object.
typedef enum TimerUtilStatusEnum | TimerUtilStatus
| Timer util status return type.
## Enumerations
enum | TimerUtilStatusEnum { TIMERUTIL_FAILURE = -1, TIMERUTIL_SUCCESS = 0 }
| Return values for timer util API calls. More...
## Functions
static TimerUtilStatus | TimerUtil_reset (TimerUtilHandle hTimer)
| Resets the state of the timer. Must be called before other timer util API calls.
static TimerUtilStatus | TimerUtil_delta (TimerUtilHandle hTimer, unsigned long *deltaPtr)
| Calculates the delta in microseconds between now and the last time delta was called (or when reset was called if that is more recent).
static TimerUtilStatus | TimerUtil_total (TimerUtilHandle hTimer, unsigned long *totalPtr)
| Calculates the delta in microseconds between now and the last time reset was called.

## Typedef Documentation

typedef struct TimerUtilObjStruct TimerUtilObj

| Object that stores the state of the timer. Needs to be declared by the application and passed to the timerutil API calls.

typedef TimerUtilObj* TimerUtilHandle

| Pointer to a timer state object.

typedef enum TimerUtilStatusEnum TimerUtilStatus

| Timer util status return type.

## Enumeration Type Documentation

enum TimerUtilStatusEnum

  | Return values for timer util API calls. Enumerator:
  TIMERUTIL_FAILURE |
  TIMERUTIL_SUCCESS |

## Function Documentation

static TimerUtilStatus TimerUtil_reset | ( | TimerUtilHandle | hTimer | ) | `[inline, static]`

  | Resets the state of the timer. Must be called before other timer util API calls. Parameters:
  | hTimer | Handle of the timer to reset.
Returns: TIMERUTIL_SUCCESS for success and TIMERUTIL_FAILURE for failure.

static TimerUtilStatus TimerUtil_delta | ( | TimerUtilHandle | hTimer,
|  | unsigned long * | deltaPtr
| ) | `[inline, static]`

  | Calculates the delta in microseconds between now and the last time delta was called (or when reset was called if that is more recent). Parameters:
  | hTimer | Handle of the timer to calculate a delta on.
  | deltaPtr | Pointer to where the resulting value will be stored if the operation was successful.
Returns: TIMERUTIL_SUCCESS for success and TIMERUTIL_FAILURE for failure.

static TimerUtilStatus TimerUtil_total | ( | TimerUtilHandle | hTimer,
|  | unsigned long * | totalPtr
| ) | `[inline, static]`

  | Calculates the delta in microseconds between now and the last time reset was called. Parameters:
  | hTimer | Handle of the timer to calculate a delta on.
  | totalPtr | Pointer to where the resulting value will be stored if the operation was successful.
Returns: TIMERUTIL_SUCCESS for success and TIMERUTIL_FAILURE for failure.

Copyright 2006, Texas Instruments Incorporated