Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[HelpMe] how can I measure time difference in the unit less tick?

37 views
Skip to first unread message

Kim, Jeong-Hwan

unread,
Sep 17, 2001, 10:01:30 PM9/17/01
to
Hi, every one
I measure time difference between events in unit of tick using "tickGet()".
Howerver, now fine time resolution is need.
How can I measure time difference in the unit less "tick"?

Thanks in advance

Kim

ellin

unread,
Sep 18, 2001, 2:34:18 AM9/18/01
to
"Kim, Jeong-Hwan" <KimJeo...@lge.com> wrote in message news:<_Vxp7.50890$2k2.2...@news.bora.net>...

Try codes listed below, you may need to change the MACRO definition
according to your hardware.


#define TIMEBASE_HZ 16666667
#define TIMEBASE_PERIOD (1.0 / TIMEBASE_HZ)

double double_time(void)
{
UINT32 tbu, tbl;
vxTimeBaseGet(&tbu, &tbl); /* Get 64-bit ticks value */
return (tbu * 4294967296.0 + tbl) * TIMEBASE_PERIOD;
}

int TestCode()
{
double ts,te,tu;

ts =double_time();

...
Your_Operations();
...

te =double_time();
tu =(te -ts)*1.0e6;

}

HTH,

ellin

Joe Durusau

unread,
Sep 18, 2001, 9:42:32 AM9/18/01
to
If you want really acurat timing, use a hardware device. One such is
the IP-480 series fro Acromag, and I'm sure there are others. (I don't
work for them).

Speaking only for myself,

Joe Durusau

Mike Kordik

unread,
Sep 18, 2001, 9:35:14 AM9/18/01
to
Are you using a Pentium? If so it has high speed counters that can be used
for this purpose. Enable the timestamp driver in your kernel and use the
timestamp API to get high resolution timing.

Mike


"Kim, Jeong-Hwan" <KimJeo...@lge.com> wrote in message
news:_Vxp7.50890$2k2.2...@news.bora.net...

0 new messages