41 lines
886 B
C++
41 lines
886 B
C++
#ifdef _WIN64
|
|
#define UNICODE
|
|
#define WIN32_LEAN_AND_MEAN
|
|
//#define DllImport __declspec( dllimport )
|
|
#include <Windows.h>
|
|
#include <libloaderapi.h>
|
|
#endif
|
|
|
|
#include "../debug.h"
|
|
#include "../tmrtsc.hpp"
|
|
|
|
using namespace tmr;
|
|
|
|
#ifdef _WIN64
|
|
int main(int argc, char** argv){
|
|
HMODULE dell;
|
|
DWORD fracaso;
|
|
int sleep = 1000;
|
|
|
|
dell = LoadLibraryExW(TEXT("libtmrtsc.dll"), NULL, NULL);
|
|
if (dell == NULL) {
|
|
fracaso = GetLastError();
|
|
return -1;
|
|
}
|
|
TSCTimer* timer = nullptr;
|
|
fracaso = TSCTimer::getTimer(timer);
|
|
if(fracaso != OPERATION_SUCCESSFUL)
|
|
return -2;
|
|
uint64_t t1 = timer->getTimeStamp();
|
|
Sleep(sleep);
|
|
uint64_t t2 = timer->getTimeStamp();
|
|
uint64_t fr = timer->getBaseFrequency();
|
|
std::cout << "Windows Momento: \nt1: " << t1 << " t2: " << " fr: " << fr << std::endl;
|
|
return 0;
|
|
}
|
|
|
|
#else
|
|
int main(int argc, char** argv){
|
|
return -9;
|
|
}
|
|
#endif
|