MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / formatTime

Function formatTime

test/browser/test_html5_core.c:197–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195}
196
197void formatTime(char *str, int seconds) {
198 int h = seconds / (60*60);
199 seconds -= h*60*60;
200 int m = seconds / 60;
201 seconds -= m*60;
202 if (h > 0)
203 {
204 sprintf(str, "%dh:%02dm:%02ds", h, m, seconds);
205 }
206 else
207 {
208 sprintf(str, "%02dm:%02ds", m, seconds);
209 }
210}
211
212void log_battery_state(const EmscriptenBatteryEvent *e) {
213 char t1[64];

Callers 1

log_battery_stateFunction · 0.85

Calls 1

sprintfFunction · 0.85

Tested by

no test coverage detected