+ added -vs for time stamping

git-svn-id: trunk@6176 -
This commit is contained in:
florian 2007-01-24 20:32:06 +00:00
parent 3ce0e329bd
commit dac9896a6d
4 changed files with 28 additions and 14 deletions

View File

@ -52,6 +52,7 @@ Const
V_Conditional = $10000; V_Conditional = $10000;
V_Debug = $20000; V_Debug = $20000;
V_Executable = $40000; V_Executable = $40000;
V_TimeStamps = $80000;
V_LevelMask = $fffffff; V_LevelMask = $fffffff;
V_All = V_LevelMask; V_All = V_LevelMask;
V_Default = V_Fatal + V_Error + V_Normal; V_Default = V_Fatal + V_Error + V_Normal;
@ -156,7 +157,7 @@ const
implementation implementation
uses uses
cutils, systems cutils, systems, globals
; ;
{**************************************************************************** {****************************************************************************
@ -248,6 +249,7 @@ const
rh_warningstr = 'warning:'; rh_warningstr = 'warning:';
var var
hs : string; hs : string;
hs2 : string;
begin begin
def_comment:=false; { never stop } def_comment:=false; { never stop }
hs:=''; hs:='';
@ -324,6 +326,11 @@ begin
else else
hs:=s; hs:=s;
end; end;
if (status.verbosity and V_TimeStamps)<>0 then
begin
system.str(getrealtime-starttime:0:3,hs2);
hs:='['+hs2+'] '+s;
end;
{ Display line } { Display line }
if ((status.verbosity and (Level and V_LevelMask))=(Level and V_LevelMask)) then if ((status.verbosity and (Level and V_LevelMask))=(Level and V_LevelMask)) then

View File

@ -209,22 +209,14 @@ function Compile(const cmd:string):longint;
end; end;
end; end;
function getrealtime : real;
var
h,m,s,s1000 : word;
begin
DecodeTime(Time,h,m,s,s1000);
result:=h*3600.0+m*60.0+s+s1000/1000.0;
end;
var var
starttime : real;
timestr : string[20]; timestr : string[20];
linkstr : string[64]; linkstr : string[64];
{$ifdef SHOWUSEDMEM} {$ifdef SHOWUSEDMEM}
hstatus : TFPCHeapStatus; hstatus : TFPCHeapStatus;
{$endif SHOWUSEDMEM} {$endif SHOWUSEDMEM}
ExceptionMask : TFPUExceptionMask; ExceptionMask : TFPUExceptionMask;
totaltime : real;
begin begin
try try
try try
@ -257,10 +249,10 @@ begin
{ Show statistics } { Show statistics }
if status.errorcount=0 then if status.errorcount=0 then
begin begin
starttime:=getrealtime-starttime; totaltime:=getrealtime-starttime;
if starttime<0 then if totaltime<0 then
starttime:=starttime+3600.0*24.0; totaltime:=totaltime+3600.0*24.0;
timestr:=tostr(trunc(starttime))+'.'+tostr(trunc(frac(starttime)*10)); timestr:=tostr(trunc(totaltime))+'.'+tostr(round(frac(totaltime)*10));
if status.codesize<>-1 then if status.codesize<>-1 then
linkstr:=', '+tostr(status.codesize)+' ' +strpas(MessagePChar(general_text_bytes_code))+', '+tostr(status.datasize)+' '+strpas(MessagePChar(general_text_bytes_data)) linkstr:=', '+tostr(status.codesize)+' ' +strpas(MessagePChar(general_text_bytes_code))+', '+tostr(status.datasize)+' '+strpas(MessagePChar(general_text_bytes_data))
else else

View File

@ -313,10 +313,13 @@ interface
{ actual values are defined in ncgutil.pas } { actual values are defined in ncgutil.pas }
nroftrashvalues = 4; nroftrashvalues = 4;
var
starttime : real;
function getdatestr:string; function getdatestr:string;
function gettimestr:string; function gettimestr:string;
function filetimestring( t : longint) : string; function filetimestring( t : longint) : string;
function getrealtime : real;
procedure DefaultReplacements(var s:string); procedure DefaultReplacements(var s:string);
@ -583,6 +586,14 @@ implementation
end; end;
function getrealtime : real;
var
h,m,s,s1000 : word;
begin
DecodeTime(Time,h,m,s,s1000);
result:=h*3600.0+m*60.0+s+s1000/1000.0;
end;
{**************************************************************************** {****************************************************************************
Default Macro Handling Default Macro Handling
****************************************************************************} ****************************************************************************}

View File

@ -295,6 +295,10 @@ var
status.verbosity:=status.verbosity and (not V_Executable) status.verbosity:=status.verbosity and (not V_Executable)
else else
status.verbosity:=status.verbosity or V_Executable; status.verbosity:=status.verbosity or V_Executable;
'S' : if inverse then
status.verbosity:=status.verbosity and (not V_TimeStamps)
else
status.verbosity:=status.verbosity or V_TimeStamps;
'V' : PrepareReport; 'V' : PrepareReport;
end; end;
inc(i); inc(i);