OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of using operating system dependent functionality.
os.times() method in Python is used to get the current global process times.
Parameter: No parameter is required.
Return Type: This method returns a tuple-like object with five named attributes which represents the current global process times. The five attributes are as follows:
- user: It represents the user time.
- system: It represents the system time
- children_user: It represents the user time of all child processes.
- children_system: It represents the system time of all child processes.
- elapsed: It represents the elapsed real time since a fixed point in the past.
Note: On Windows, only user and system attributes are known and other attributes have value 0.
Code: Use of os.times() method to get the current global process times.
posix.times_result(user=0.03, system=0.01, children_user=0.0, children_system=0.0, elapsed=17370844.95)
- class method vs static method in Python
- Difference between Method Overloading and Method Overriding in Python
- Get() method for dictionaries in Python
- Real-Time Edge Detection using OpenCV in Python | Canny edge detection method
- Python Program to detect the edges of an image using OpenCV | Sobel edge detection method
- Line detection in python with OpenCV | Houghline method
- Python | os._exit() method
- Python | os.WEXITSTATUS() method
- Python | os.abort() method
- Python | os.renames() method
- Python | os.lseek() method
- Python calendar module | formatmonth() method
- Python | PyTorch sin() method
- Python | Sympy Line.is_parallel() method
- Python PIL | GaussianBlur() method
- Python | range() method
- Python | Numpy np.hermefit() method
- Python | Numpy np.hermevander() method
- Python String Title method
- Python groupby method to remove all consecutive duplicates