How to print out the current CPU clock in Zephyr OS? #84633
Answered
by
ldomaigne
MasterKeyxda
asked this question in
Q&A
-
I am looking to print out the current system clock in MHz or Hz using the printf() function. Is there a way I can get the information? |
Beta Was this translation helpful? Give feedback.
Answered by
ldomaigne
Feb 3, 2025
Replies: 1 comment 1 reply
-
Hi, If I understand your question correctly, you could get the CPU clock speed in Hz, KHz or MHz using the function
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
MasterKeyxda
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
If I understand your question correctly, you could get the CPU clock speed in Hz, KHz or MHz using the function
k_xxx_to_cyc_floor32
from time_unit.h (or the floor64 variant if you prefer 64 bits integer):