summaryrefslogtreecommitdiff
path: root/src/common/timer.cpp
diff options
context:
space:
mode:
authorGravatar Lioncash2018-04-29 18:37:15 -0400
committerGravatar Lioncash2018-04-29 18:52:33 -0400
commit3abba08080c88c49359e91ab2688c23fa066110a (patch)
treec354d58817e230cc2ba1306e449628ef8dafeb3d /src/common/timer.cpp
parentMerge pull request #421 from Subv/sh_pred3 (diff)
downloadyuzu-3abba08080c88c49359e91ab2688c23fa066110a.tar.gz
yuzu-3abba08080c88c49359e91ab2688c23fa066110a.tar.xz
yuzu-3abba08080c88c49359e91ab2688c23fa066110a.zip
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.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 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <time.h> 5#include <ctime>
6
7#include <fmt/format.h>
8
6#ifdef _WIN32 9#ifdef _WIN32
7#include <windows.h> 10#include <windows.h>
8// windows.h needs to be included before other windows headers 11// windows.h needs to be included before other windows headers
@@ -104,8 +107,8 @@ std::string Timer::GetTimeElapsedFormatted() const {
104 // Hours 107 // Hours
105 u32 Hours = Minutes / 60; 108 u32 Hours = Minutes / 60;
106 109
107 std::string TmpStr = StringFromFormat("%02i:%02i:%02i:%03i", Hours, Minutes % 60, Seconds % 60, 110 std::string TmpStr = fmt::format("{:02}:{:02}:{:02}:{:03}", Hours, Minutes % 60, Seconds % 60,
108 Milliseconds % 1000); 111 Milliseconds % 1000);
109 return TmpStr; 112 return TmpStr;
110} 113}
111 114
@@ -165,11 +168,11 @@ std::string Timer::GetTimeFormatted() {
165#ifdef _WIN32 168#ifdef _WIN32
166 struct timeb tp; 169 struct timeb tp;
167 (void)::ftime(&tp); 170 (void)::ftime(&tp);
168 return StringFromFormat("%s:%03i", tmp, tp.millitm); 171 return fmt::format("{}:{:03}", tmp, tp.millitm);
169#else 172#else
170 struct timeval t; 173 struct timeval t;
171 (void)gettimeofday(&t, nullptr); 174 (void)gettimeofday(&t, nullptr);
172 return StringFromFormat("%s:%03d", tmp, (int)(t.tv_usec / 1000)); 175 return fmt::format("{}:{:03}", tmp, static_cast<int>(t.tv_usec / 1000));
173#endif 176#endif
174} 177}
175 178