"Atle R�stad" writes: > Hi > > I have some code that has a max of 30 milliseconds to process, and need to > measure if this is possible. But the requirement for Duration is that > Duration'Small must be less then 20 milliseconds, and > Ada.Real_Time.Time_Unit must be less then 20 microseconds. [...] > I will run the program on an Solaris 8. How will this affect my time > measuring? What resolution can I expect? (1) On Solaris (>=2.6 or so, I think) the default operating system tick is 10 mS. (2) GNAT uses nanosleep() to implement delay (pretty sure of this). (3) nanosleep() sleeps for *at least* the time you specify, rounded up to an integral number of ticks. (4) So, if you "delay 0.000_001;", you'll delay for at least 10 mS and up to 20 mS. However, you can change the OS tick to 1 mS by writing set hires_tick 1 in /etc/system (I may have the exact grammar wrong, mail me at work for the details). This will give you a maximum repetition frequency of 500 Hz. NB, that 1 is a boolean meaning 'true', _not_ the number of milliseconds! Running as root gives you real-time dispatching but doesn't change the behaviour of nanosleep(). Linux is similar, though there's no easy way to change the tick rate (you can edit /usr/include/asm/param.h, or figure a way to redefine HZ, and rebuild the kernel; worked fine for us, but YMMV, though, since the library won't match). And don't try delays < 2 mS as root, they're executed as busy loops. -- Simon Wright Work Email: simon.j.wright@amsjv.com Alenia Marconi Systems Voice: +44(0)23-9270-1778 Integrated Systems Division FAX: +44(0)23-9270-1800