mirror of
https://github.com/gbudny93/RouterOS_Useful_Scripts.git
synced 2025-08-29 06:08:14 +02:00
Initial Commit
This commit is contained in:
parent
2f897350bc
commit
9bd877b7fa
3 changed files with 139 additions and 0 deletions
32
RouterOS_Measure_Execution_Time.rsc
Normal file
32
RouterOS_Measure_Execution_Time.rsc
Normal file
|
@ -0,0 +1,32 @@
|
|||
# RouterOS Function
|
||||
# Copyright (c) Grzegorz Budny
|
||||
# Version 1.0
|
||||
# Last update: 3/22/2020
|
||||
# Measures script execution time
|
||||
|
||||
:global MeasureExecutionTime do={
|
||||
|
||||
:local timeDifferance;
|
||||
:local startTime [/system clock get time];
|
||||
|
||||
/system script run $scriptName;
|
||||
|
||||
:local endTime [/system clock get time]
|
||||
:set $timeDifferance ($endTime-$startTime);
|
||||
|
||||
:if($return) do={
|
||||
|
||||
:return $timeDifferance;
|
||||
|
||||
}\
|
||||
else={
|
||||
|
||||
:put ("Script executed in : ".$timeDifferance);
|
||||
|
||||
}
|
||||
|
||||
:set $timeDifferance;
|
||||
|
||||
}
|
||||
|
||||
$MeasureExecutionTime scriptName=scriptName return=true;
|
Loading…
Add table
Add a link
Reference in a new issue