#include "stdafx.h"
#include <iostream>
#include <Windows.h>
#include <conio.h>
int _tmain(int argc, _TCHAR* argv[])
{
double start = 0;
double current = 0;
int update = 1000;
do
{
start = GetTickCount();
while( ( current < update ) && ( ! _kbhit() ) )
{
current = GetTickCount() - start;
}
std::cout << current << '\n';
current = 0;
}while( ! _kbhit() );
return 0;
}
When changing int update 1000;, it seems the lower I go, the close to the actual update number I get.
Within a range of approx. 20, from 1000, the output is almost always 1014.
If this is ticks per second, shouldn't there be the slightest change in the output with almost any change of update?