On 15 July 2011 03:07, Jeff Epler <[email protected]> wrote:
> rtapi_get_time is presently implemented in terms of rtai's
> rt_get_cpu_time_ns, which is implemented in terms of rdtsc and llimd.
> it looks like it should work just fine and efficiently.
As an example, I tried the following comp:
component timetest;
pin out float time_ns;
license "GPL";
author "andy pugh";
function _;
variable float khz;
option extra_setup yes;
;;
FUNCTION(_){
u64 T, D, A;
T = rtapi_get_clocks();
D = rtapi_get_clocks() - T;
T = rtapi_get_clocks();
A = rtapi_get_time();
A =rtapi_get_clocks() - T - D;
time_ns = (A / khz) * 1e6;
}
EXTRA_SETUP(){
khz = cpu_khz;
return 0;
}
On my D510MO Atom board and the results were:
https://picasaweb.google.com/lh/photo/7f8mvTZ_y9hf6t_Lhwu6bg?feat=directlink
Never less than 100nS, and peaking at 384nS. (If my arithmetic is correct)
--
atp
"Torque wrenches are for the obedience of fools and the guidance of wise men"
------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric
Ries, the creator of the Lean Startup Methodology on "Lean Startup
Secrets Revealed." This video shows you how to validate your ideas,
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers