Dear GPC Creators,
I'm using GPC 20070904 to compile the following on Windows within MinGW:
program p;
function GetMicroSecondTime:longint; external name '_p_GetMicroSecondTime';
var i,j:integer; x:real;
begin for i:=0 to 10 do begin for j:=0 to 100000 do x:=j/2; writeln(GetMicroSecondTime); end; end.
On Linux with GPC 20041218, and on MacOS with GPC 20051116, the program produced output like this:
1194023823927008 1194023823934003 1194023823940745 1194023823947257 1194023823955457 1194023823977409 1194023823984707 1194023823990997 1194023823997348 1194023824003602 1194023824023001
But with the GPC 20070904 and MinGW, I get this:
1194023823000000 1194023823000000 1194023823000000 1194023823000000 1194023823000000 1194023823000000 1194023823000000 1194023823000000 1194023823000000 1194023824000000 1194023824000000
It appears that the microsecond part of the time is not working.
Yours, Kevan
Kevan Hashemi a écrit:
Dear GPC Creators,
I'm using GPC 20070904 to compile the following on Windows within MinGW:
program p;
function GetMicroSecondTime:longint; external name '_p_GetMicroSecondTime';
var i,j:integer; x:real;
begin for i:=0 to 10 do begin for j:=0 to 100000 do x:=j/2; writeln(GetMicroSecondTime); end; end.
On Linux with GPC 20041218, and on MacOS with GPC 20051116, the program produced output like this:
1194023823927008 1194023823934003 1194023823940745 1194023823947257 1194023823955457 1194023823977409 1194023823984707 1194023823990997 1194023823997348 1194023824003602 1194023824023001
But with the GPC 20070904 and MinGW, I get this:
1194023823000000 1194023823000000 1194023823000000 1194023823000000 1194023823000000 1194023823000000 1194023823000000 1194023823000000 1194023823000000 1194023824000000 1194023824000000
It appears that the microsecond part of the time is not working.
Same with djgpp. In this case this is due to the granularity of the clock used, which is 1/60 th second (IIRC). Put a readln after writeln to slow down at will, and see what happens.
Maurice
Dear Maurice,
Same with djgpp. In this case this is due to the granularity of the clock used, which is 1/60 th second (IIRC).
I see.
Put a readln after writeln to slow down at will, and see what happens.
I still get only whole seconds from the timer. No matter what, the value of GetMicroSecondTime is always a mulitiple of 1 second.
Yours, Kevan