07/16/2014 6:36 AM
post111066
|
Hello guys,
I try to run some measurements on my TQMa28 Board with QNX. For that I created a very easy program.
strt = ClockCycles();
usleep(5);
end = ClockCycles();
elapsed_clks = end - strt;
elapsed_ns[count] = messwerte * 1000000000 / SYSPAGE_ENTRY(qtime)->cycles_per_sec;
First of all, I use ClockCycles(), because the clock_gettime() somehow only delievers 0.000000 even though I specified "
CLOCK_REALTIME" as the clock.
After the execution I saved the values in a .txt-file so I could read them and I was a little bit astounded because of
them.
Every value was around 2.000.000 nanoseconds and I thought that is simply impossible. Afterwards I tried the same method
without the usleep(5) (so basicly only the 2 ClockCycles()-calls) and the results were around 500ns (with my board it's
impossible to measure below 500ns because the SYSPAGE_ENTRY(qtime)->cycles_per_sec; delivers a number around 2.000.000)
.
So the 500ns was a value I did expect, with usleep I expected something around 5500ns (the usleep(x) function let's the
system sleep for x microseconds). The problem is: I need the usleep function but with results like this...
Does somebody know what I can do about this? If you have any further questions don't hesitate and ask me.
Yours sincerely
Adrian
PS: I didn't change anything of the properties everything is the default values from Momentics.
|
|
|