Escolar Documentos
Profissional Documentos
Cultura Documentos
#include <stdafx.h>
#include <tchar.h>
#include <windows.h>
#include <iostream.h>
#include <fstream.h>
int main()
{
// Prepare log for output.
ofstream timeLog ("log.txt");
if (timeLog.is_open())
{
cout << "Events Detected\n";
cout << "---------------\n\n";
//timeLog.close();
}
// Timer series.
__int64 ctr1 = 0, ctr2 = 0, freq = 0;
int acc = 0, i = 0;
if (clap == 1)
{
timeLog << "Event logged\n";
}
}
QueryPerformanceFrequency((LARGE_INTEGER *)&freq);
Console::WriteLine(S"QueryPerformanceCounter minimum resolution: 1/{
0} Seconds.",freq.ToString());
// In Visual Studio 2005, this line should be changed to: Console::W
riteLine("QueryPerformanceCounter minimum resolution: 1/{0} Seconds.",freq.ToStr
ing());
Console::WriteLine("100 Increment time: {0} seconds.",((ctr2 - ctr1)
* 1.0 / freq).ToString());
}
else
{
DWORD dwError = GetLastError();
Console::WriteLine(S"Error value = {0}",dwError.ToString());// In Vi
sual Studio 2005, this line should be changed to: Console::WriteLine("Error valu
e = {0}",dwError.ToString());
}
return 0;
}