os.times() is used in Python to get the current time of a global process.
Syntax: os.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: using the os.times () method to getting the current time of the global process.
posix.times_result (user = 0.03, system = 0.01, children_user = 0.0, children_system = 0.0 , elapsed = 17370844.95)