Community discussions

MikroTik App
 
User avatar
mozerd
Forum Veteran
Forum Veteran
Topic Author
Posts: 891
Joined: Thu Oct 05, 2017 3:39 pm
Location: Canada
Contact:

Determine the TIME is takes to complete

Sun May 13, 2018 3:41 pm

I have a number of scripts that I would like to determine the TIME is takes to complete.
In Perl its very easy to do but I have not been able to figure out how to implement similar commands under RouterOS.

In Perl to accomplish this task I would:
my $temp = time();
my $Start = $temp;
...............
.............
...............
...........
my $End = time();
my $Diff = $End - $Start;
print "Process took ".$Diff." seconds to run.\n";
Can someone provide the correct directive sequence that would work under RouterOS please?
 
User avatar
mozerd
Forum Veteran
Forum Veteran
Topic Author
Posts: 891
Joined: Thu Oct 05, 2017 3:39 pm
Location: Canada
Contact:

Re: Determine the TIME is takes to complete

Sun May 13, 2018 5:38 pm

So it looks like what I need is is a requested feature ..... viewtopic.php?f=9&t=131692#p646804

using bash its easy
SECONDS=0
# do some work
duration=$SECONDS
echo "$(($duration / 60)) minutes and $(($duration % 60)) seconds elapsed."
 
jarda
Forum Guru
Forum Guru
Posts: 7756
Joined: Mon Oct 22, 2012 4:46 pm

Re: Determine the TIME is takes to complete

Sun May 13, 2018 6:05 pm

The request for date and time calculation is older. But it seems there is an alternative...
viewtopic.php?t=119703#p602837
 
saenito
newbie
Posts: 26
Joined: Wed Aug 22, 2018 3:37 am

Re: Determine the TIME is takes to complete

Sat Mar 16, 2019 4:15 am

What about :time command?

Who is online

Users browsing this forum: No registered users and 57 guests