XTime is a custom sleep library built using ctypes to interact with low-level operating system functions. It provides a cross-platform xsleep() function similar to time.sleep(), but with more control and without importing the time module.
xsleep(seconds): A basic sleep function that works on Windows, Linux, and macOS.XSleepclass:XSleep.milliseconds(ms): Sleeps for the specified number of milliseconds.XSleep.seconds(secs): Sleeps for the specified number of seconds.XSleep.minutes(mins): Sleeps for the specified number of minutes.XSleep.hours(hrs): Sleeps for the specified number of hours.
- Additional functions (beyond
timemodule):XSleep.get_pid(): Gets the current process ID.XSleep.get_cpu_count(): Gets the number of CPUs/cores.XSleep.get_random_delay(min_seconds, max_seconds): Sleeps for a random time betweenmin_secondsandmax_seconds.XSleep.is_interactive(): Checks if the session is interactive.XSleep.get_platform(): Returns the platform identifier.XSleep.get_uptime(): Returns the system uptime in seconds.XSleep.get_free_memory(): Returns the amount of free memory in bytes.XSleep.get_username(): Returns the current username.XSleep.get_current_time_ms(): Returns the current time in milliseconds since the epoch.XSleep.execute_command(command): Executes a shell command and returns the output.XSleep.print_message_with_delay(message, delay_seconds): Prints a message with a delay before each character.
From PyPI (not yet available):
pip install XTime