Skip to content

Commit

Permalink
Note regarding CPU usage being only relative to app
Browse files Browse the repository at this point in the history
  • Loading branch information
danielamitay committed Jun 28, 2012
1 parent 27719cc commit f332c81
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Expand Up @@ -45,10 +45,11 @@ - (void)toggle:(UIButton *)button
- (void)updateCPULabel
{
// CPU information to demonstrate how much CPU DAAnisotropicImage uses
// Note that this is only app-wide CPU usage, not system-wide
// DAAnisotropicImage uses about the same amount as moving two UISliders from side to side
// In other words, it is pretty reasonable
float cpuUsage = [[NSProcessInfo processInfo] cpuUsage];
_cpuLabel.text = [NSString stringWithFormat:@"CPU Usage: %.1f%%", (cpuUsage*100.0f)];
_cpuLabel.text = [NSString stringWithFormat:@"Allocated CPU Usage: %.1f%%", (cpuUsage*100.0f)];
}

- (void)viewDidLoad
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -12,7 +12,7 @@ On June 12, 2012, Gizmodo wrote an [article](http://gizmodo.com/5917967/you-wont

You can see a YouTube video of the feature [here](http://www.youtube.com/watch?v=c9X7D87uJ7Q).

The change was criticized by some as a waste of resources and developer time. This project is a demonstration of how quickly the feature can be replicated, and how (relatively) CPU-light it is. Ultimately, this feature uses 10% of the CPU. Compare that to simply sliding a UISlider at 6%.
The change was criticized by some as a waste of resources and developer time. This project is a demonstration of how quickly the feature can be replicated, and how (relatively) CPU-light it is. Ultimately, this feature uses between 10% and 20% of the CPU. Compare that to simply sliding a UISlider at about half that amount. Note that this usage is only relative to the CPU allocated to the app. Play music in the background and the CPU usage will remain constant.

## Installation

Expand Down

0 comments on commit f332c81

Please sign in to comment.