# Method Thread.set_thread_quanta()

Method set_thread_quanta

  ``int(0..)` set_thread_quanta(`int(0..)` `ns`)`

Description

  Set the thread quanta.

Parameter `ns`

  New thread quanta in nanoseconds. A value of zero (default) disables the thread quanta checks.

  When enabled MasterObject.thread_quanta_exceeded() will be called when a thread has spent more time than the quanta without allowing another thread to run.

Note

  Setting a non-zero value that is too small to allow for MasterObject.thread_quanta_exceeded() to run is NOT a good idea.

Returns

  Returns the previous thread quanta in nanoseconds.

See also

  set_thread_quanta(), gethrtime()