Millisecond Timer Library  v0.85
Millisecond Timer Library for use with Add a Simple Library tutorial.
Functions
mstimer.h File Reference

Tracks milliseconds elapsed in another cog. This is part of a tutorial on adding a Simple Library to the project. More...

#include "simpletools.h"

Go to the source code of this file.

Functions

int mstime_start ()
 Start the millisecond timer.
void mstime_stop ()
 Stop the millisecond timer and free up a cog.
int mstime_get ()
 Get milliseconds since call to start.
void mstime_reset ()
 Reset the millisecond time elapsed to zero.
void mstime_set (int newTime)
 Set the millisecond timer.

Detailed Description

Tracks milliseconds elapsed in another cog. This is part of a tutorial on adding a Simple Library to the project.

Author
Andy Lindsay
Version
0.86
Core Usage
A call to mstime_start will launch 1 additional core. Additional calls to mstime_start will only shut down and then re-launch the process, but will not take additional cores.
Memory Models
Use with CMM or LMM.
Version
0.5
Help Improve this Library
Please submit bug reports, suggestions, and improvements to this code to edito.nosp@m.r@pa.nosp@m.ralla.nosp@m.x.co.nosp@m.m.

Function Documentation

int mstime_get ( )

Get milliseconds since call to start.

Returns
Number of milliseconds elapsed.
void mstime_set ( int  newTime)

Set the millisecond timer.

Parameters
newTimeNew millisecond time value that timer should start counting from.
int mstime_start ( )

Start the millisecond timer.

Returns
Nonzero if success, 0 if no cogs available.