[Previous] [Contents] [Next]

ticksize

Set the system timer granularity (QNX)

Syntax:

ticksize [-e] [size]

Options:

-e
Set or query ticksize in nanoseconds, using closest hardware-supported size.
size
Time duration for a clock tick. If -e is specified, size is in nanoseconds, otherwise valid numbers are .5, 1, 2, 5, 10, 25, or 50 milliseconds.

Description:

The ticksize utility queries or changes the rate at which timer interrupts (called ticks) are applied to the system. The tick size determines the granularity of all software system timers. All time requests will be rounded up to this granularity. For example, if the tick size is 10 milliseconds, a request to wait for 1 millisecond may wait for up to 10 milliseconds.

Setting the tick size will not affect the system date, nor will it affect active software timers, other than the granularity of the point where they are triggered.


Note: The timer ticksize is independent of the scheduling timeslice rate at which competing READY processes are scheduled to run.

Note also that QNX uses a realtime preemptive scheduler. Therefore, if a process becomes READY (perhaps as the result of an external interrupt) and is the highest priority process, it will be scheduled immediately. There is no delay based upon the tick size. Ticks are used for software timers only, not for round-robin scheduling granularity.


If your machine has a CPU speed rating of less than 600 as reported by:

    sin info

then you cannot set your tick size below 1 millisecond.

When QNX boots, it sets the tick size to 10 milliseconds for machines with a CPU speed greater than or equal to 300. For machines with CPU speeds less than 300, the tick size is set to 50 milliseconds.

Examples:

Query approximate current tick size:

    ticksize

Query the current tick size, to the nearest nanosecond:

    ticksize -e

Set the tick size to 50 milliseconds:

    ticksize 50

Set the tick size to .5 milliseconds:

    ticksize .5

Exit status:

0
The tick size was successfully queried or changed.
>0
An error occurred. The tick size will not be changed.

See also:

sin


[Previous] [Contents] [Next]