How to get current date time in milliseconds

Trying to get time in millis but no millis


root@AP3:~# date +"%F %T,%3N"
2023-08-20 15:20:25,
root@AP3:~#

for testing speed of scripts i need to get time in milisec .
Is it posible on ash ?

this isn't really an openwrt related question, but did you try time ?

cant find or understand how to get curent time in milisecond

do you need start, and stop time, or run time ?

i need to get time at some point in script
like start and end time
and then calculate

why, when time give you this OOTB ?

i need to measure speed for different function in my scripts

starttime=

some functions

endtime=

timespeed=endtime-startime

idk what OOTB means

Ok, and ?

Pretty sure google does.

busybox contains common shell commands, but each with limited features.

try installing the fullblown date command via opkg: coreutils-date

1 Like

yeah i googled what OOTB means
and i try time with diffrent options but no luck cant get curent time in millis

adjtimex | grep -i tv | cut -d: -f2 | sed 's/^ *//g' | tr '\n' '.' | sed 's/.$/\n/'

1 Like

thanks a lot now i can test
iw with grep awk works faster than json

root@AP3:~# /root/qtest.sh
ee:52:2a:09:59:ba -32
22
-33
111 and 41
root@AP3:~#

almost 2 times
for my task grep better
ofcouse json is much powerfull than grep awk etc but in my case iw works beter

yes i need to compare json and grep with iw
so iw with grep in my case works faster 2 times
so i apply iw with grep in my script
but i know the power of json

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.