//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
//---------------------------------------------------------------------------
#pragma argsused
#include <time.h>
#include <stdio.h>
#include <dos.h>
#include "conio.h"
int main(void)
{
clock_t start, end;
// puts("timer start:\n");
start = clock();
printf("%d\n",start);
//delay(2000);
//Sleep(2000);
for(long i=0;i<11800000;i++)
{
;;;;;;;;;;;
}
end = clock();
printf("%d",end);
//puts("timer end:\n");
printf("The time was: %fus\n", (end - start)*1000.0); //us
printf("The time was: %fms\n", (end - start)/1.0); //ms
printf("The time was: %fs\n", (end - start) / CLK_TCK); //1000.0 //s
getch();
return 0;
}
//---------------------------------------------------------------------------
评论0