This is the old SliTaz forum - Please use the main

usleep and nanosleep
  • OliTazOliTaz February 2011
    Is it possible to use precise usleep and nanosleep with this OS. The first try that I have made are really not precise.
  • Trixar_zaTrixar_za February 2011
    There doesn't seem to be a nanosleep function in slitaz, but there is the sleep command for seconds, minutes, hours or days and a usleep function that works in milliseconds.

    You can also get the real gnu sleep command by installing the coreutils-command package.

    The question is why do you need a command that works in nanoseconds?
  • OliTazOliTaz February 2011
    I want to send IR code using GPIO pins. So I have to respect the IR protocol thant use bit that are 6.944us long. It is maybe not possible with this interface or Linux. I will probably be block by the scheduler.
  • Trixar_zaTrixar_za February 2011
    So it's 6.944 microseconds bursts?

    Maybe install coreutils-command and then using sleep 0.000006944 to do it?

    brenton@trixarian:~$ sleep 0.000006944; echo test
  • devl547devl547 February 2011
    >Is it possible to use precise usleep and nanosleep with this OS.

    Yes. Dont know if it will be as precise as in QNX or Hard-RT linux, but still you can.

    >are really not precise.

    Use realtime linux sources from repos and build a custom kernel. Default kernel is not supposed to do such kind of stuff.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

SliTaz Social