+ 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_Debug = $20000;
V_Executable = $40000;
V_TimeStamps = $80000;
V_LevelMask = $fffffff;
V_All = V_LevelMask;
V_Default = V_Fatal + V_Error + V_Normal;
@ -156,7 +157,7 @@ const
implementation
uses
cutils, systems
cutils, systems, globals
;
{****************************************************************************
@ -248,6 +249,7 @@ const
rh_warningstr = 'warning:';
var
hs : string;
hs2 : string;
begin
def_comment:=false; { never stop }
hs:='';
@ -324,6 +326,11 @@ begin
else
hs:=s;
end;
if (status.verbosity and V_TimeStamps)<>0 then
begin
system.str(getrealtime-starttime:0:3,hs2);
hs:='['+hs2+'] '+s;
end;
{ Display line }
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;
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
starttime : real;
timestr : string[20];
linkstr : string[64];
{$ifdef SHOWUSEDMEM}
hstatus : TFPCHeapStatus;
{$endif SHOWUSEDMEM}
ExceptionMask : TFPUExceptionMask;
totaltime : real;
begin
try
try
@ -257,10 +249,10 @@ begin
{ Show statistics }
if status.errorcount=0 then
begin
starttime:=getrealtime-starttime;
if starttime<0 then
starttime:=starttime+3600.0*24.0;
timestr:=tostr(trunc(starttime))+'.'+tostr(trunc(frac(starttime)*10));
totaltime:=getrealtime-starttime;
if totaltime<0 then
totaltime:=totaltime+3600.0*24.0;
timestr:=tostr(trunc(totaltime))+'.'+tostr(round(frac(totaltime)*10));
if status.codesize<>-1 then
linkstr:=', '+tostr(status.codesize)+' ' +strpas(MessagePChar(general_text_bytes_code))+', '+tostr(status.datasize)+' '+strpas(MessagePChar(general_text_bytes_data))
else

View File

@ -313,10 +313,13 @@ interface
{ actual values are defined in ncgutil.pas }
nroftrashvalues = 4;
var
starttime : real;
function getdatestr:string;
function gettimestr:string;
function filetimestring( t : longint) : string;
function getrealtime : real;
procedure DefaultReplacements(var s:string);
@ -583,6 +586,14 @@ implementation
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
****************************************************************************}

View File

@ -295,6 +295,10 @@ var
status.verbosity:=status.verbosity and (not V_Executable)
else
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;
end;
inc(i);