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: [email protected] [mailto:[email protected]] On
> Behalf Of Kate Feng
> Sent: Tuesday, April 22, 2003 8:25 AM
> To: [email protected]
> 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
<2003>
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- 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
<2003>
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|