summaryrefslogtreecommitdiffstats
path: root/src/common/timer.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-04-30 03:49:13 +0200
committerGitHub <noreply@github.com>2018-04-30 03:49:13 +0200
commit81a0082f6bd4f2db9b09e56cce96351bb5084e46 (patch)
tree4309e2b742d485f9854bbe63de4393f7e8785f5c /src/common/timer.cpp
parentMerge pull request #422 from bunnei/shader-mov (diff)
parentstring_util: Remove StringFromFormat() and related functions (diff)
downloadyuzu-81a0082f6bd4f2db9b09e56cce96351bb5084e46.tar
yuzu-81a0082f6bd4f2db9b09e56cce96351bb5084e46.tar.gz
yuzu-81a0082f6bd4f2db9b09e56cce96351bb5084e46.tar.bz2
yuzu-81a0082f6bd4f2db9b09e56cce96351bb5084e46.tar.lz
yuzu-81a0082f6bd4f2db9b09e56cce96351bb5084e46.tar.xz
yuzu-81a0082f6bd4f2db9b09e56cce96351bb5084e46.tar.zst
yuzu-81a0082f6bd4f2db9b09e56cce96351bb5084e46.zip
Diffstat (limited to '')
-rw-r--r--src/common/timer.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/common/timer.cpp b/src/common/timer.cpp
index c9803109e..f0c5b1a43 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
}