Simple StopWatch class to measure elapsed time

Inspired by a question about resetting millis() on the forum today I developped a simple StopWatch Class. As it is a Class one can instantiate standalone stopwatches or an array of them. As it is based upon millis() it inherits some of its behavior...

The class has 5 functions and a constructor:

      StopWatch();            // constructor
      void start();            // start / continue the measurement
      void stop();            // stops the measurement
      long reset();            // reset the measurement (can't continue)
      unsigned long value();      // elapsed time since start (leaptime)
      bool isRunning();      // current state of the stopwatch

Have a look at - Arduino Playground - StopWatchClass - for the details.

Suggestions, improvements and other comments ? let me know : enjoy tinkering

Rob

I have a suggestion... Push the implementation up into the header file. This gives the compiler the option to inline the short methods.

Another suggestion... I think this can be removed from the CPP file...

#include "Wstring.h"

And the filename is probably case sensitive on *nix operating systems...

#include "wiring.h"

Nice and well documented - thanks for sharing

Thank you for posting this and documenting it. Nice simple library.