stopwatch.c File Reference

Definitions for timer utilities. More...

Include dependency graph for stopwatch.c:

Go to the source code of this file.

Functions

void stopwatch_init (struct stopwatch *timer)
 Initializes a timer.
void stopwatch_start (struct stopwatch *timer)
 Starts a timing run.
void stopwatch_stop (struct stopwatch *timer, const struct timestamp *now)
 Stops a timing run, accumulating it into the total.
void timestamp_add (struct timestamp *dest, const struct timestamp *src)
 Element-wise addition of a timestamp.
void timestamp_init (struct timestamp *dest)
 Initializes a timestamp to zero.
void timestamp_now (struct timestamp *dest)
 Records the current time.
void timestamp_now_rev (struct timestamp *dest)
 Records the current time.
void timestamp_sub (struct timestamp *dest, const struct timestamp *src)
 Element-wise subtraction of a timestamp.

Detailed Description

Definitions for timer utilities.

Definition in file stopwatch.c.


Function Documentation

void stopwatch_init ( struct stopwatch timer  ) 

Initializes a timer.

Definition at line 108 of file stopwatch.c.

References stopwatch::start, timestamp_init(), and stopwatch::total.

Referenced by fx_get_timer(), and fx_reset_timer().

void stopwatch_start ( struct stopwatch timer  ) 

Starts a timing run.

Definition at line 114 of file stopwatch.c.

References stopwatch::start, and timestamp_now_rev().

Referenced by fx_timer_start().

void stopwatch_stop ( struct stopwatch timer,
const struct timestamp now 
)

Stops a timing run, accumulating it into the total.

Definition at line 122 of file stopwatch.c.

References stopwatch::start, timestamp_add(), timestamp_init(), timestamp_sub(), and stopwatch::total.

Referenced by fx_timer_stop().

void timestamp_add ( struct timestamp dest,
const struct timestamp src 
)

Element-wise addition of a timestamp.

Definition at line 56 of file stopwatch.c.

References timestamp::cpu, and timestamp::micros.

Referenced by stopwatch_stop().

void timestamp_init ( struct timestamp snapshot  ) 

Initializes a timestamp to zero.

Definition at line 51 of file stopwatch.c.

Referenced by stopwatch_init(), and stopwatch_stop().

void timestamp_now ( struct timestamp dest  ) 

Records the current time.

The highest-precision operations are found first.

Definition at line 80 of file stopwatch.c.

References timestamp::cpu, and timestamp::micros.

Referenced by fx_done(), and fx_timer_stop().

void timestamp_now_rev ( struct timestamp dest  ) 

Records the current time.

The highest-precision operations are found last.

Definition at line 93 of file stopwatch.c.

References timestamp::cpu, and timestamp::micros.

Referenced by stopwatch_start().

void timestamp_sub ( struct timestamp dest,
const struct timestamp src 
)

Element-wise subtraction of a timestamp.

Definition at line 68 of file stopwatch.c.

References timestamp::cpu, and timestamp::micros.

Referenced by stopwatch_stop().

Generated on Mon Jan 24 12:04:38 2011 for FASTlib by  doxygen 1.6.3