diff options
author | Lioncash <mathew1800@gmail.com> | 2018-04-29 18:37:15 -0400 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2018-04-29 18:52:33 -0400 |
commit | 3abba08080c88c49359e91ab2688c23fa066110a (patch) | |
tree | c354d58817e230cc2ba1306e449628ef8dafeb3d /src/common/timer.cpp | |
parent | 869075867bf7bda1323ee2bb32ec45a89dfdb0ca (diff) |
string_util: Remove StringFromFormat() and related functions
Given we utilize fmt, we don't need to provide our own functions for formatting anymore
Diffstat (limited to 'src/common/timer.cpp')
-rw-r--r-- | src/common/timer.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/common/timer.cpp b/src/common/timer.cpp index c9803109e7..f0c5b1a430 100644 --- a/src/common/timer.cpp +++ b/src/common/timer.cpp @@ -2,7 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include <time.h> +#include <ctime> + +#include <fmt/format.h> + #ifdef _WIN32 #include <windows.h> // windows.h needs to be included before other windows headers @@ -104,8 +107,8 @@ std::string Timer::GetTimeElapsedFormatted() const { // Hours u32 Hours = Minutes / 60; - std::string TmpStr = StringFromFormat("%02i:%02i:%02i:%03i", Hours, Minutes % 60, Seconds % 60, - Milliseconds % 1000); + std::string TmpStr = fmt::format("{:02}:{:02}:{:02}:{:03}", Hours, Minutes % 60, Seconds % 60, + Milliseconds % 1000); return TmpStr; } @@ -165,11 +168,11 @@ std::string Timer::GetTimeFormatted() { #ifdef _WIN32 struct timeb tp; (void)::ftime(&tp); - return StringFromFormat("%s:%03i", tmp, tp.millitm); + return fmt::format("{}:{:03}", tmp, tp.millitm); #else struct timeval t; (void)gettimeofday(&t, nullptr); - return StringFromFormat("%s:%03d", tmp, (int)(t.tv_usec / 1000)); + return fmt::format("{}:{:03}", tmp, static_cast<int>(t.tv_usec / 1000)); #endif } |