An academic exercise. Ideally, the most compact timer you can find. For the moment C++ only. Also, an example of integration with p3em for energy measure.
It works with the tik/tok scheme and comes with a test unit. It contains:
tik: starts stopwatch, void if repeated w/o stop in betweentok: prints total time; does not stop the clocktak: prints lap (i.e. time elapsed since last valid lap, tak or tik)rst: resetpws: pauses total and lap time;lap: like tak but no print, only returntot: like tok but no print, only return
Salvatore Cielo, Leibniz-Rechenzentrum
Apache II
The test unit is not compatible with p3em energy :'(. Will have to think of some new tests.