kolibri/utils/pskolibri/_pswindows.py
def cpu_times():
    """Return system CPU times as a named tuple."""
    idle_time, kernel_time, user_time = FILETIME(), FILETIME(), FILETIME()
    kernel32.GetSystemTimes(
        ctypes.byref(idle_time), ctypes.byref(kernel_time), ctypes.byref(user_time)
    )

    idle = HI_T * idle_time.dwHighDateTime + LO_T * idle_time.dwLowDateTime
    user = HI_T * user_time.dwHighDateTime + LO_T * user_time.dwLowDateTime
    kernel = HI_T * kernel_time.dwHighDateTime + LO_T * kernel_time.dwLowDateTime
    # Kernel time includes idle time.
    # We return only busy kernel time subtracting idle time from
    # kernel time.
    system = kernel - idle

    return scputimes(user, system, idle)
Return system CPU times as a named tuple.
Return system CPU times as a named tuple.
Return system CPU times as a named tuple .
def cpu_times():
    idle_time, kernel_time, user_time = FILETIME(), FILETIME(), FILETIME()
    kernel32.GetSystemTimes(
        ctypes.byref(idle_time), ctypes.byref(kernel_time), ctypes.byref(user_time)
    )
    idle = HI_T * idle_time.dwHighDateTime + LO_T * idle_time.dwLowDateTime
    user = HI_T * user_time.dwHighDateTime + LO_T * user_time.dwLowDateTime
    kernel = HI_T * kernel_time.dwHighDateTime + LO_T * kernel_time.dwLowDateTime
    system = kernel - idle
    return scputimes(user, system, idle)
def cpu_times ( ) : idle_time , kernel_time , user_time = FILETIME ( ) , FILETIME ( ) , FILETIME ( ) kernel32 . GetSystemTimes ( ctypes . byref ( idle_time ) , ctypes . byref ( kernel_time ) , ctypes . byref ( user_time ) ) idle = HI_T * idle_time . dwHighDateTime + LO_T * idle_time . dwLowDateTime user = HI_T * user_time . dwHighDateTime + LO_T * user_time . dwLowDateTime kernel = HI_T * kernel_time . dwHighDateTime + LO_T * kernel_time . dwLowDateTime system = kernel - idle return scputimes ( user , system , idle )
Return system CPU times as a named tuple.
Return system CPU times as a named tuple .
"""Return system CPU times as a named tuple.""" # Kernel time includes idle time. # We return only busy kernel time subtracting idle time from # kernel time.