diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2021-10-07 21:42:40 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-10-07 21:09:38 +0200 |
commit | 900fac27c6c4e8b5cb56c74f0829cf8e9213c763 (patch) | |
tree | 48854d47e8eabe0ed36e19fa616adaacf96e890c /Kernel/Arch/x86/common/Processor.cpp | |
parent | 99582773171750fc949aa11f4603f54b9d53e8b1 (diff) | |
download | serenity-900fac27c6c4e8b5cb56c74f0829cf8e9213c763.zip |
Kernel: Add Processor::time_spent_idle()
Diffstat (limited to 'Kernel/Arch/x86/common/Processor.cpp')
-rw-r--r-- | Kernel/Arch/x86/common/Processor.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Kernel/Arch/x86/common/Processor.cpp b/Kernel/Arch/x86/common/Processor.cpp index 36913ad128..fb97ab0d65 100644 --- a/Kernel/Arch/x86/common/Processor.cpp +++ b/Kernel/Arch/x86/common/Processor.cpp @@ -1323,4 +1323,9 @@ void Processor::assume_context(Thread& thread, FlatPtr flags) VERIFY_NOT_REACHED(); } +u64 Processor::time_spent_idle() const +{ + return m_idle_thread->time_in_user() + m_idle_thread->time_in_kernel(); +} + } |