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:
4
quit.cpp
4
quit.cpp
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user