LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

any function to get milliseconds in labwindows

Hi,
 
   I am using LabWindows 7.1.1 cvi.I would like to know a function in labwindows which will retrun time in milliseconds.At present I am using a function timer which will return time in seconds but my requirement to get time in milliseconds.
 
Please suggest me a solution.
 
Thanks in advance.
 
With Regards,
krishna
 
0 Kudos
Message 1 of 4
(5,027 Views)

 Hi krishna,

Check out the GetSystemTime Windows SDK function. This discussion forum post talks about this.

Let me know if you have any problems.

Best Regards,

Jonathan N.
National Instruments
0 Kudos
Message 2 of 4
(5,020 Views)
You might want to use GetLocalTime out of the Win32 SDK, else you get UTC.

GetLocalTime has the additional advantage of not colliding with the NI GetSystemTime function.

If you use GetSystemTime and you're also using utility.h, you have to #undef the NI function and provide a prototype for the Win32 function.

Menchar
0 Kudos
Message 3 of 4
(5,015 Views)
Hi Krishna,
 
If you do not require absolute time, another way is using clock().
This function will return an integer containing the number of milliseconds since the program started.
0 Kudos
Message 4 of 4
(5,006 Views)