mirror of
https://github.com/rzeldent/esp32cam-rtsp.git
synced 2025-11-14 20:18:01 +00:00
Additional Diagnostics
This commit is contained in:
11
include/format_duration.h
Normal file
11
include/format_duration.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
String format_duration(time_t seconds)
|
||||
{
|
||||
auto days = seconds / (60 * 60 * 24);
|
||||
auto tm = gmtime(&seconds);
|
||||
String duration = days > 0 ? String(days) + " days, " : "";
|
||||
char time_buff[9];
|
||||
strftime(time_buff, 9, "%H:%M:%S", tm);
|
||||
return duration + time_buff;
|
||||
}
|
||||
Reference in New Issue
Block a user