简体   繁体   English

Xcode活动监视器中的CPU使用率异常

[英]Strange CPU usage in Xcode Activity Monitor

This is a bit strange. 这有点奇怪。 When I execute the same app without changing anything in my code (just clicking "Record" in the Activity Monitor Instrument), I will get varying CPU on different runs - and it always varies by 10%. 当我执行相同的应用程序而不更改代码中的任何内容时(只需在“活动监视器”工具中单击“记录”),我将在不同的运行中获得不同的CPU,并且它总是相差10%。

This isn't switching back and forth in any systematic way, so my app can run at 30% CPU or 40% CPU (allowing the CPU to reach an equilibrium after a few seconds of startup). 这不是以任何系统的方式来回切换,因此我的应用程序可以在30%CPU或40%CPU上运行(允许CPU在启动几秒钟后达到平衡)。

What's causing this if nothing is changed in my code. 如果我的代码没有任何变化,这是什么引起的。 Is it due to internal processes on the device? 是由于设备上的内部流程引起的吗?

在此处输入图片说明

在此处输入图片说明

EDIT: 编辑:

Also, I don't retain any information or to my knowledge use any time varying functions (apart from the seed in some random functions...) 另外,我不保留任何信息,或者就我所知,我不使用任何时变函数(除了一些随机函数中的种子外……)

I think, CPU % will vary a little, for each execution. 我认为,每次执行时,CPU%会有所不同。

The application should be executed for say 10 times, and the average CPU % should be considered as its actual load. 该应用程序应执行10次,平均CPU%应视为其实际负载。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM