summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Timer.cpp
diff options
context:
space:
mode:
authorPierre Bourdon <delroth@gmail.com>2014-02-09 16:12:59 +0100
committerPierre Bourdon <delroth@gmail.com>2014-02-09 16:14:13 +0100
commite59f770ccbf61f012d148a390e7f76775ab2a02e (patch)
tree4fd9c32775ca42490d8bf498e13049f4353c3037 /Source/Core/Common/Timer.cpp
parent9da6900595318620690a5cdb5094a05e17cf094e (diff)
Revert "Merge pull request #49 from Parlane/sprintf_tidy"
Change broke the build on Debian stable. This reverts commit 28755439b36ac8e875d764da5db31ad693459ace, reversing changes made to 64e01ec763d21915e7166e625f8a3e85b46fbcbb.
Diffstat (limited to 'Source/Core/Common/Timer.cpp')
-rw-r--r--Source/Core/Common/Timer.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/Source/Core/Common/Timer.cpp b/Source/Core/Common/Timer.cpp
index 91a2a2d3ad..267755fb17 100644
--- a/Source/Core/Common/Timer.cpp
+++ b/Source/Core/Common/Timer.cpp
@@ -167,23 +167,27 @@ u64 Timer::GetLocalTimeSinceJan1970()
std::string Timer::GetTimeFormatted()
{
time_t sysTime;
+ struct tm * gmTime;
+ char formattedTime[13];
+ char tmp[13];
+
time(&sysTime);
-
- struct tm * gmTime = localtime(&sysTime);
+ gmTime = localtime(&sysTime);
- char tmp[13];
strftime(tmp, 6, "%M:%S", gmTime);
// Now tack on the milliseconds
#ifdef _WIN32
struct timeb tp;
(void)::ftime(&tp);
- return StringFromFormat("%s:%03i", tmp, tp.millitm);
+ sprintf(formattedTime, "%s:%03i", tmp, tp.millitm);
#else
struct timeval t;
(void)gettimeofday(&t, NULL);
- return StringFromFormat("%s:%03d", tmp, (int)(t.tv_usec / 1000));
+ sprintf(formattedTime, "%s:%03d", tmp, (int)(t.tv_usec / 1000));
#endif
+
+ return std::string(formattedTime);
}
// Returns a timestamp with decimals for precise time comparisons