Barrelfish
Typedefs | Functions
timer.h File Reference

Barrelfish timer interface. More...

Typedefs

typedef void(* timer_callback_fn) (struct timer *, void *)
 

Functions

errval_t timer_init (void)
 Initialize timer subsystem.
 
struct timer * timer_new (void)
 Create new timer. More...
 
void timer_start (struct timer *timer)
 Start timer. More...
 
void timer_stop (struct timer *timer)
 Stop timer. More...
 
uint64_t timer_remaining (struct timer *timer)
 Return remaining time of timer. More...
 
void timer_destroy (struct timer *timer)
 Destroy a timer. More...
 
bool timer_is_running (struct timer *timer)
 Returns true iff the given timer is active / enqueued.
 

Detailed Description

Barrelfish timer interface.

Typedef Documentation

typedef void(* timer_callback_fn) (struct timer *, void *)

Timer callback function prototype.

Function Documentation

void timer_destroy ( struct timer *  timer)

Destroy a timer.

Stops and removes timer from system.

Parameters
timerPointer to timer to destroy.
struct timer* timer_new ( void  )

Create new timer.

TimerAPI Timer API

(...)

Returns
Pointer to new timer.
uint64_t timer_remaining ( struct timer *  timer)

Return remaining time of timer.

Parameters
timerPointer to running timer.
Returns
Remaining time, in us.
void timer_start ( struct timer *  timer)

Start timer.

This sets off a timer. It will start running for the duration set through timer_set_duration().

Parameters
timerPointer to timer to start.
void timer_stop ( struct timer *  timer)

Stop timer.

This stops a running timer.

Parameters
timerPointer to timer to stop.