Does anyone know how to obtain CPU usage for an application? It's definitely possible, because there are application in app store (Activity Monitor Touch) which can show it.
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- Xcode: Is there a way to change line spacing (UI L
- Unable to process app at this time due to a genera
Try this:
However, that method calculates the percentages based on the starting point of each process. If you are looking for the more traditional way of calculating these numbers, see Petesh's answer.
For Swift 3:
Update. This code is working for me:
Update 2. The thread_list was leaking, so added vm_deallocate