1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-09-04 19:47:54 +00:00

gametime available in formulas

This commit is contained in:
Zeno Rogue
2024-05-28 15:09:18 +02:00
parent 99bc842c57
commit 727ae8a260
3 changed files with 7 additions and 1 deletions

View File

@@ -26,6 +26,10 @@ EX int getgametime() {
return (int) (savetime + (timerstopped ? 0 : (time(NULL) - timerstart)));
}
EX ld getgametime_precise() {
return savetime + (timerstopped ? 0 : (ticks - tickstart) / 1000.);
}
EX string getgametime_s(int timespent IS(getgametime())) {
return hr::format("%d:%02d", timespent/60, timespent % 60);
}