mightymandel v16

GPU-based Mandelbrot set explorer

stopwatch.c File Reference

(v16)

#include "stopwatch.h"
#include <stdlib.h>
#include <time.h>
+ Include dependency graph for stopwatch.c:

Go to the source code of this file.

Data Structures

struct  stopwatch

Functions

double time_difference (const struct timespec *t1, const struct timespec *t0)
 Find the difference between two times.
struct stopwatchstopwatch_new ()
 Create a new stopwatch.
void stopwatch_start (struct stopwatch *t)
 Start a stopwatch.
void stopwatch_stop (struct stopwatch *t)
 Stop a stopwatch.
void stopwatch_delete (struct stopwatch *t)
 Delete a stopwatch.
void stopwatch_reset (struct stopwatch *t)
 Reset a stopwatch.
double stopwatch_elapsed (struct stopwatch *t)
 Get the elapsed time of a stopwatch.

Data Structure Documentation

struct stopwatch

Definition at line 26 of file stopwatch.c.

Data Fields
double elapsed
struct timespec start
struct timespec stop

Function Documentation

void stopwatch_delete ( struct stopwatch t)

Delete a stopwatch.

Parameters
tThe stopwatch.

Definition at line 135 of file stopwatch.c.

Referenced by poll_delete(), and render_end().

+ Here is the caller graph for this function:

double stopwatch_elapsed ( struct stopwatch t)

Get the elapsed time of a stopwatch.

Parameters
tThe stopwatch.
Returns
The total elapsed time in seconds.

Definition at line 145 of file stopwatch.c.

References stopwatch::elapsed, stopwatch_start(), and stopwatch_stop().

Referenced by main(), poll_ui(), render_calculate(), and render_display().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

struct stopwatch* stopwatch_new ( )
read

Create a new stopwatch.

Returns
The new stopwatch.

Definition at line 32 of file stopwatch.c.

Referenced by main(), poll_new(), and render_begin().

+ Here is the caller graph for this function:

void stopwatch_reset ( struct stopwatch t)

Reset a stopwatch.

Parameters
tThe stopwatch.

Definition at line 139 of file stopwatch.c.

References stopwatch::elapsed, stopwatch_start(), and stopwatch_stop().

Referenced by main(), poll_set_timeout(), poll_ui(), and render_calculate().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void stopwatch_start ( struct stopwatch t)

Start a stopwatch.

Parameters
tThe stopwatch.

Definition at line 36 of file stopwatch.c.

References stopwatch::start.

Referenced by poll_new(), stopwatch_elapsed(), and stopwatch_reset().

+ Here is the caller graph for this function:

void stopwatch_stop ( struct stopwatch t)

Stop a stopwatch.

Parameters
tThe stopwatch.

Definition at line 40 of file stopwatch.c.

References stopwatch::elapsed, stopwatch::start, stopwatch::stop, and time_difference().

Referenced by stopwatch_elapsed(), and stopwatch_reset().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double time_difference ( const struct timespec *  t1,
const struct timespec *  t0 
)

Find the difference between two times.

Parameters
t1The later time.
t0The earlier time.
Returns
The time difference in seconds computed as t1 - t0.

Definition at line 22 of file stopwatch.c.

Referenced by stopwatch_stop().

+ Here is the caller graph for this function: