Stopwatch library with start, stop, and getTime functions. Returns a 00:00:00 in MM:SS:MS format with a max duration of ~30min per documentation on the Timer class. Can easily be output through an LCD/TFT with printf(stopwatch.getTime());
Fork of Stopwatch by
Stopwatch.h
- Committer:
- mdomino
- Date:
- 2012-07-16
- Revision:
- 0:3328857bf625
- Child:
- 2:2202f5336acb
File content as of revision 0:3328857bf625:
#include "stdio.h" #include "stdlib.h" #include "math.h" #include "mbed.h" class Stopwatch { public: Stopwatch(); ~Stopwatch(); void start(); void stop(); char* getTime(); void countDown(int startTime); private: int ms; int sec; int min; char buffer[9]; Timer sw; };