Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  <20032004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  <20032004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019 
<== Date ==> <== Thread ==>

Subject: RE: epicsTicksPerSecond for OSI ?
From: "Jeff Hill" <johill@lanl.gov>
To: "'Kate Feng'" <feng1@bnl.gov>, <tech-talk@aps.anl.gov>
Date: Tue, 22 Apr 2003 09:03:31 -0600
Hi Kate,

There are certainly easy ways to compute the difference between
two EPICS time stamps in seconds and you can also convert an
EPICS time stamp to an enhanced struct tm (ANSI C) which includes
the nanoseconds within a second in addition to the conventional
date, hour, and second fields. For example, the following code
measures the delay required to do some computationally intensive
task and also computes the current date and time.

epicsTime begin = epicsTime::getCurrent();
..
.. something computationally intensive
..
// compute the delay
double delayInSeconds = epicsTime::getCurrent() - begin;

// compute the date
local_tm_nano_sec localDAteAndTime = epicsTime::getCurrent();

However, perhaps what you are after is thread sleep scheduling
accuracy? If so, then you may be pleased with the addition of
"double epicsThreadSleepQuantum(void)" to the epicsThread API in
the next release of R3.14. This function returns the minimum
sleep interval obtainable from the local OS and has been very
useful for improving the accuracy of timers on average.

Jeff

> -----Original Message-----
> From: feng@iota.aps.anl.gov [mailto:feng@iota.aps.anl.gov] On
> Behalf Of Kate Feng
> Sent: Tuesday, April 22, 2003 8:25 AM
> To: tech-talk@aps.anl.gov
> Subject: epicsTicksPerSecond for OSI ?
> 
> Hi,
> 
> As I am working on the OSI, I feel it would be handy to have
> the global
> variable "epicsTicksPerSecond" for the R3.14.1 OSI, which is
> equivalent
> to the vxTicksPerSecond variable in the VxWorks O.S..  Right
> now, the
> vxTicksPerSecond=60, and rtemsTicksPerSecond=50.  I did not
> check for
> other O.S.
> 
> 
> It is just a thought.  Maybe, it is called a different name.
> Or, maybe
> there is a reason not to have it.
> 
> 
> Thanks,
> Kate



Replies:
Re: epicsTicksPerSecond for OSI ? Kate Feng
References:
epicsTicksPerSecond for OSI ? Kate Feng

Navigate by Date:
Prev: Re: epicsTicksPerSecond for OSI ? Eric Norum
Next: Re: epicsTicksPerSecond for OSI ? Kate Feng
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  <20032004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019 
Navigate by Thread:
Prev: Re: epicsTicksPerSecond for OSI ? Eric Norum
Next: Re: epicsTicksPerSecond for OSI ? Kate Feng
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  <20032004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019 
ANJ, 10 Aug 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·