From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get milisecond out from time function?

Solved!
Go to solution

Hi All

 

I am using time function to get the current time of the step. I am getting only in hh:mm:ss format and unable to get miliseconds. However miliseconds are getting updated in local.I am not able to get in the final OP.

 

Is there anyway to get the miliseconds from time function ?

0 Kudos
Message 1 of 5
(4,127 Views)

Not sure what you are after exactly, but the following should return milliseconds in Locals.ms.

Locals.timeString=Time(False,Locals.hours,Locals.min,Locals.sec,Locals.ms)


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
0 Kudos
Message 2 of 5
(4,120 Views)

Thanks for reply.

I am doing the same thing. but in the final string(here Timestring) I am only getting values till seconds.

However if i think the ms local value it is getting updated with miliseconds value.

But in the timestring I am not able to get the milisecond value.

0 Kudos
Message 3 of 5
(4,113 Views)
Solution
Accepted by topic author LV_user1

I dont think you can do that with the time function directly.

You will just have to concatenate the ms value!

Locals.timeString=Time(False,Locals.hours,Locals.min,Locals.sec,Locals.ms),Locals.timeString+="."+Str(Locals.ms)


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
Message 4 of 5
(4,106 Views)

Thanks ...it worked  Smiley Happy

0 Kudos
Message 5 of 5
(4,091 Views)