Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
说明:实现突发时间是随机分配的(10x10^6 周期 - 50x10^12 周期)。我如何将其转换为 ms 突发时间的测量值。
理论上?选择一个你知道它是准确的时钟,运行 10^6 个周期的模拟突发,并测量花费了多长时间。
现在,每当您获得分配的突发时,除以最初测量的时间即可获得挂钟持续时间。
仅当循环执行时间固定时才有效。因此,根据设计,它不适用于任何具有动态时钟状态的非嵌入式 CPU 或现代架构,这些架构无法在恒定的指令吞吐量下被骗忙等待。