mirror of
https://github.com/Team-Resurgent/PrometheOS-Launcher.git
synced 2026-08-15 11:18:38 -07:00
29 lines
632 B
C++
29 lines
632 B
C++
#include "timeUtility.h"
|
|
#include "xboxInternals.h"
|
|
#include <time.h>
|
|
|
|
uint64_t timeUtility::getMillisecondsNow()
|
|
{
|
|
return (uint64_t)GetTickCount();
|
|
}
|
|
|
|
double timeUtility::getDurationSeconds(uint64_t start, uint64_t end)
|
|
{
|
|
return (end - start) / (double)1000;
|
|
}
|
|
|
|
double timeUtility::calculateFramesPerSecond(uint32_t frameCount, double duration)
|
|
{
|
|
return frameCount / duration;
|
|
}
|
|
|
|
char* timeUtility::getTimeString()
|
|
{
|
|
time_t rawtime;
|
|
struct tm *timeinfo;
|
|
char buffer[80];
|
|
time(&rawtime);
|
|
timeinfo = localtime(&rawtime);
|
|
strftime(buffer, sizeof(buffer), "%Y%m%d%H%M%S", timeinfo);
|
|
return strdup(buffer);
|
|
} |