MyChat Scripts: function GetTickCount, a number of milliseconds passed from the start of the host system
"For developers", "Server scripts", "Functions descriptions", "Other", "GetTickCount".
The function for getting the up-time of the Windows host system in milliseconds.
Syntax
function GetTickCount: string;
Function result
Milliseconds, type int64.
Example
Calculating the time spent on script execution for performance profiling .
var
iStart: int64;
i: integer;
r: double;
begin
iStart := GetTickCount;
for i := 1 to 100000 do
r := Sqrt(Random(1000000)) + Sin(Random(1000));
mLogScript(IntToStr(GetTickCount - iStart), 'milliseconds');
end.
Script work result
[12:18:20] (Log "GetTickCount"): [milliseconds] 453
[12:18:20] (Run "GetTickCount"): Script operation time: 454 ms
[12:18:20] (Run "GetTickCount"): Script done successfully.