I did something like this:
function createTimeFile:boolean;
var
IDs:TIntegerArray;
Count:Integer;
begin
Ids := SmartGetClientIDs;
Count := Length(IDs);
If (Count = 0) then
begin
If not(FileExists(ScriptPath+'sys.txt')) then begin
CreateFile(ScriptPath+'sys.txt');
SMARTtime1:=RewriteFile(ScriptPath+'sys.txt',false);
end else begin
SMARTtime1:=RewriteFile(ScriptPath+'sys.txt',false);
end;
if not(SMARTtime1=-1) then Result:=true;
end;
end;
function saveSmartTime:boolean;
begin
if createTimeFile then
begin
if WriteFileString(SMARTtime1,ToStr(GetSystemTime)) then
begin
CloseFile(SMARTtime1);
Result:=true;
end;
end else
begin
try
CloseFile(SMARTtime1);
except
end;
end;
end;
function timeFromSMARTstart:Integer;
var
number:String;
startingTime:Integer;
begin
If FileExists(ScriptPath+'sys.txt') then
begin
SMARTtime1:=OpenFile(ScriptPath+'sys.txt',true);
if not(SMARTtime1=-1) then
begin
If ReadFileString(SMARTtime1,number,FileSize(SMARTtime1)) then
startingTime:=StrToInt(number);
if (startingTime>0) then begin
Result:=getsystemtime-startingTime;
end;
end;
CloseFile(SMARTtime1);
end;
end;
// Nevermind managed to find it out what GetSystemTime is returning its time from swtching on computer,so my functions are working :)