GY-63_MS5611/libraries/timing/examples/milliSeconds/milliSeconds.ino

48 lines
804 B
Arduino
Raw Normal View History

2021-01-29 06:31:58 -05:00
//
// FILE: milliSeconds.ino
// AUTHOR: Rob Tillaart
// VERSION: 0.1.0
// PURPOSE: demo
// DATE: 2020
// URL: https://github.com/RobTillaart/timing
//
#include "timing.h"
void setup()
{
Serial.begin(115200);
Serial.println(__FILE__);
delay(10);
milliSeconds mis; // starts at zero
for (uint32_t i = 0; i < 1000; i++)
{
Serial.print(i);
Serial.print("\t");
Serial.println(i*i);
}
uint32_t x = mis.now();
Serial.print("milliseconds:\t");
Serial.println(x);
mis.set(0); // starts at zero
for (uint32_t i = 0; i < 1000; i++)
{
Serial.print(i);
Serial.print("\t");
Serial.println(i*i);
}
x = mis.now();
Serial.print("milliseconds:\t");
Serial.println(x);
Serial.println("\nDone...");
}
void loop()
{
}
// -- END OF FILE --