sleep()

Pauses the execution of the current thread for a specified number of milliseconds.

This function is accepts a delay in milliseconds.

It temporarily releases the Global Interpreter Lock (GIL) while sleeping, allowing other Python threads to run.

Syntax

planetcnc.sleep(ms)

Parameters

Parameter Type Description
ms int The duration to sleep, in milliseconds.

Return Value

Examples

#! /usr/bin/env python 
 
import planetcnc
 
# Pause execution for 500 milliseconds.
planetcnc.sleep(500)
print("Resumed after 500 ms")

See also

sleep