Initial commit
This commit is contained in:
commit
edfc5298e1
252 changed files with 93965 additions and 0 deletions
28
source/Platform/Win32/Win32System.cpp
Normal file
28
source/Platform/Win32/Win32System.cpp
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
|
||||
#include <Windows.h>
|
||||
#include <Spectre/System/System.h>
|
||||
|
||||
static LARGE_INTEGER getFrequency() {
|
||||
|
||||
LARGE_INTEGER freq;
|
||||
::QueryPerformanceFrequency(&freq);
|
||||
return freq;
|
||||
}
|
||||
|
||||
unsigned long System::getMilliseconds()
|
||||
{
|
||||
static LARGE_INTEGER freq = getFrequency();
|
||||
|
||||
LARGE_INTEGER cnt;
|
||||
::QueryPerformanceCounter(&cnt);
|
||||
|
||||
cnt.QuadPart *= 1000;
|
||||
cnt.QuadPart /= freq.QuadPart;
|
||||
|
||||
return (unsigned long) cnt.QuadPart;
|
||||
}
|
||||
|
||||
void System::sleep(int milliseconds)
|
||||
{
|
||||
::Sleep(milliseconds);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue