Und was spricht jetzt unbedingt gegen ein Extraprogramm? (muß ja nicht aufwendig sein)
Delphi-Quellcode:
Program CalcTime;
{$APPTYPE CONSOLE}
Uses SysUtils;
Var N:
String;
F: TextFile;
T: TDateTime;
Begin
Try
N := ChangeFileExt(ParamStr(0), '
.time');
If SameText(ParamStr(1), '
/start')
Then Begin
Assign(F, N);
Rewrite(F);
Write(F, Now);
CloseFile(F);
End Else If SameText(ParamStr(1), '
/stop')
Then Begin
Assign(F, N);
Reset(F);
Read(F, T);
CloseFile(F);
DeleteFile(N);
WriteLn(TimeToStr(Now - T));
End Else Raise Exception.Create('
unknown parameter');
Except
On E:
Exception do Writeln(E.Classname, '
: ', E.
Message);
End;
End.
Code:
CalcTime /start
...
CalcTime /stop
oder
Code:
CalcTime /start
...
CalcTime /stop > Logfile.txt
(ungetestet ... nur mal schnell so zusammengetippt)