Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
8 changed files
with
124 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -614,4 +614,28 @@ inline const char *bool_to_cstr(bool val) | ||
return val ? "true" : "false"; | ||
} | ||
|
||
inline const std::string duration_to_string(int sec) | ||
{ | ||
int min = floor(sec / 60); | ||
sec %= 60; | ||
int hour = floor(min / 60); | ||
This comment has been minimized.
Sorry, something went wrong.
SmallJoker
Member
|
||
min %= 60; | ||
|
||
std::stringstream ss; | ||
if (hour > 0) { | ||
ss << hour << "h "; | ||
} | ||
|
||
if (min > 0) { | ||
ss << min << "m "; | ||
} | ||
|
||
if (sec > 0) { | ||
ss << sec << "s "; | ||
} | ||
|
||
return ss.str(); | ||
} | ||
|
||
|
||
#endif |
myround
here too.