close
#include <cstdlib>
#include <iostream>
#include <time.h>
#include <windows.h>
using namespace std;
clock_t c1 = 0, c2 = 0;
//各類timer宣告以及取值//
time_t t1 = time(NULL);
DWORD d1 = GetTickCount();
DWORD d2 = timeGetTime();
LARGE_INTEGER L; //QueryPerformanceFrequency(&L);
FILETIME F; //GetSystemTimeAsFileTime(&F);
void interrupt(void)
{
if(c1 - c2 > 1000)
{
printf("1\t");
c2 = clock();
}
}
int main(int argc, char *argv[])
{
while(1)
{
c1 = clock();
interrupt();
}
system("pause");
return EXIT_SUCCESS;
}
全站熱搜
留言列表