mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 04:38:49 +00:00
Revert "Merge pull request #49 from Parlane/sprintf_tidy"
Change broke the build on Debian stable. This reverts commit28755439b3
, reversing changes made to64e01ec763
.
This commit is contained in:
parent
9da6900595
commit
e59f770ccb
13 changed files with 112 additions and 65 deletions
|
@ -167,23 +167,27 @@ u64 Timer::GetLocalTimeSinceJan1970()
|
|||
std::string Timer::GetTimeFormatted()
|
||||
{
|
||||
time_t sysTime;
|
||||
time(&sysTime);
|
||||
|
||||
struct tm * gmTime = localtime(&sysTime);
|
||||
|
||||
struct tm * gmTime;
|
||||
char formattedTime[13];
|
||||
char tmp[13];
|
||||
|
||||
time(&sysTime);
|
||||
gmTime = localtime(&sysTime);
|
||||
|
||||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue