Hi
You can use "time()" function for this.
Example:
time_t start_time;
void setup() {
Serial.begin(115200);
time(&start_time);
}
void loop() {
time_t cur_time;
sleep(1);
Serial.println(time(&cur_time) - start_time);
}
Best regards,
Kamil
Dear Customers and Partners.
This website will be undergoing scheduled maintenance on June 14, 2023. Please be aware there may be disruption to the developer portal website and associated services during the scheduled maintenance period.
This upgrade is essential to ensure the continued performance, reliability, and security of Developer World.
We apologize for any inconvenience.