GY-63_MS5611/libraries/Stopwatch_RT/examples/stopwatch_printable/stopwatch_printable.ino
2021-12-28 17:04:43 +01:00

49 lines
849 B
C++

//
// FILE: stopwatch_printable.ino
// AUTHOR: Rob Tillaart
// PURPOSE: sample demo stopwatch class
// DATE: 2021-01-08
// URL: https://github.com/RobTillaart/StopWatch_RT
#include <StopWatch.h>
StopWatch stopwatch;
void setup()
{
Serial.begin(115200);
Serial.println(__FILE__);
Serial.println(STOPWATCH_LIB_VERSION);
stopwatch.setResolution(StopWatch::MICROS);
test_printTo();
stopwatch.setResolution(StopWatch::MILLIS);
test_printTo();
stopwatch.setResolution(StopWatch::SECONDS);
test_printTo();
stopwatch.setResolution(StopWatch::MINUTES);
test_printTo();
}
void loop()
{
}
void test_printTo()
{
stopwatch.start();
delay(2000);
Serial.print("TIME: ");
Serial.println(stopwatch); // printable interface
Serial.print("TIME: ");
Serial.println(stopwatch.elapsed());
}
// -- END OF FILE --