Skip to content
Commit c31d6461 authored by Nicolas Pitre's avatar Nicolas Pitre Committed by Carles Cufí
Browse files

kernel: timeout: optimize z_timeout_expires()



This currently calls timeout_rem() then adds back the result of
elapsed() to cancel out the subtraction of another elapsed() call
within timeout_rem(). Better not to make any calls to elapsed() in
that case, especially given that elapsed() may incur hardware access
overhead through sys_clock_elapsed().

Let's move the elapsed() subtraction to the only user of timeout_rem()
that needs it and remove its invocation from the z_timeout_expires()
path entirely.

Signed-off-by: default avatarNicolas Pitre <npitre@baylibre.com>
parent 7072e751
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment