fixunix
Tags Register FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

Time measurement in Microseconds - VxWorks

This is a discussion on Time measurement in Microseconds - VxWorks ; Hi All 1) I want to measure the time difference of the orders of microseconds. But if the difference is of this order than the programe is showing me zero diffence. - I have a interrupt rate set to 60 ...


Fix Unix > Other OS > VxWorks > Time measurement in Microseconds

Reply
 
LinkBack Tools
  #1  
Old 10-02-2007, 08:23 AM
Junior Member
 
Join Date: Sep 2009
Posts: 0
Default Time measurement in Microseconds

Hi All

1) I want to measure the time difference of the orders of microseconds.
But if the difference is of this order than the programe is showing me
zero diffence.

- I have a interrupt rate set to 60 ticks per second.
sysClkRateGet( ) gives 60 ticks/sec

1.a) How can i get the time diffence of around 5 microseconds?

2) tickGet( ) gives new time in number of ticks.
2.a) My question is that how this number of ticks are updated?
2.b) Will the nubmer of ticks returned by the tickGet( ) function
be incremented by 60 because sysClkRateGet( ) is showing 60 ticks/sec?
2.c) What is the relation of sysClkRateGet( ) & tickGet( )?

I am using vxWorks 5.4.2 with Tornado 2 on solaris platform.

Please help me to solve the queries

Thanks in Advance.

Regards,

Äshwani Kathuria.

Reply With Quote
  #2  
Old 10-02-2007, 08:23 AM
Junior Member
 
Join Date: Sep 2009
Posts: 0
Default Re: Time measurement in Microseconds

Hi there,

I'll try and answer some of your queries:

1.
a) Based solely on your clock rate, the smallest delay you can measure
is 1 / 60 = 0.0167 seconds, or about 17 milliseconds (~17000
microseconds). There's no way you can measure a time difference that
small without using some other higher-resolution clock. I work with PPC
architecture, and we use the timebase registers onboard to measure
delays of that order. I'm not knowledgeable about what is available to
you on Solaris, maybe someone else will know.

2.
a) An interrupt function connected to the system clock updates the tick
counter, 60 times a second in your case. See the VxWorks docs for the
function tickAnnounce() and usrClock() for more info (and/or look
around on this newsgroup).
b) The number of ticks returned by the tickGet() function will be
updated 60 times a second, as per your clock rate. So, if you ran
tickGet() once every second exactly, the value would be updated by
exactly 60 (assuming no other overhead). If you ran tickGet() twice a
second, you would see it updated by exactly 30, etc.
c) sysClkRateGet() returns the number of times the system tick counter
is updated every second; tickGet() shows the current value of the tick
counter.

HTH,
Ben.

Reply With Quote
  #3  
Old 10-02-2007, 08:23 AM
Junior Member
 
Join Date: Sep 2009
Posts: 0
Default Re: Time measurement in Microseconds

Hi Ben,

Thanks for the information.

Äshwani Kathuria

Reply With Quote
  #4  
Old 04-12-2009, 11:04 AM
Junior Member
 
Join Date: Apr 2009
Posts: 2
Default Re: Time measurement in Microseconds

HI Ben,

I am usnig PPC processor as the target, could you please help me how to measure the time in terms of at least microseconds on this chip. I am using VxWorks as the OS. I want to measure the time taken by different function calls in my code.

Thanks
Anwar

Quote:
Originally Posted by Ben View Post
Hi there,

I'll try and answer some of your queries:

1.
a) Based solely on your clock rate, the smallest delay you can measure
is 1 / 60 = 0.0167 seconds, or about 17 milliseconds (~17000
microseconds). There's no way you can measure a time difference that
small without using some other higher-resolution clock. I work with PPC
architecture, and we use the timebase registers onboard to measure
delays of that order. I'm not knowledgeable about what is available to
you on Solaris, maybe someone else will know.

2.
a) An interrupt function connected to the system clock updates the tick
counter, 60 times a second in your case. See the VxWorks docs for the
function tickAnnounce() and usrClock() for more info (and/or look
around on this newsgroup).
b) The number of ticks returned by the tickGet() function will be
updated 60 times a second, as per your clock rate. So, if you ran
tickGet() once every second exactly, the value would be updated by
exactly 60 (assuming no other overhead). If you ran tickGet() twice a
second, you would see it updated by exactly 30, etc.
c) sysClkRateGet() returns the number of times the system tick counter
is updated every second; tickGet() shows the current value of the tick
counter.

HTH,
Ben.
Reply With Quote
  #5  
Old 04-12-2009, 11:08 AM
Junior Member
 
Join Date: Apr 2009
Posts: 2
Default Re: Time measurement in Microseconds

HI Ben,

I want to measure the time taken by each portion of my code. I am looking for a resolution in micro seconds. I dont think using ticks will help in this matter. The target processor is MPC 8323 (Power PC). could you please help me in this matter. I am using VxWorks-6.6 as the OS.

Thanks
Anwar
Reply With Quote
Reply

Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
performance measurement unix Hewlett Packard 4 02-08-2008 06:44 PM
[PATCH -rt] preempt_max_latency to microseconds unix Kernel 0 12-12-2007 05:40 PM
Angular measurement unix DICOM 3 11-06-2007 06:23 AM
How to checkprobe measurement (horns field measurement) unix DICOM 1 10-09-2007 05:56 PM
time measurement unix Programmer 0 10-04-2007 05:28 PM


All times are GMT. The time now is 09:58 AM.