Skip to content

ConexusIA/XTime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XTime

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.

Features

  • xsleep(seconds): A basic sleep function that works on Windows, Linux, and macOS.
  • XSleep class:
    • 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 time module):
    • 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 between min_seconds and max_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.

Installation

From PyPI (not yet available):

pip install XTime

About

XTime: Improved sleep(), flexible time units and system utilities.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages