★ TouchArcade needs your help. Click here to support us on Patreon.

The code behind Hand Heater app?

03-11-2011, 02:00 AM
Joined: Mar 2011
Posts: 1
The code behind Hand Heater app?

I am asking this not because iw ant to make a hand heater app, but I'd like to learn/experiment how can you stress a iphone cpu?

What are the codes involved?

Any thoughts are appreciated Thanks.
03-11-2011, 08:32 AM
Ok, here's how to melt down your iPhone:

1) Very important! Use [[UIApplication sharedApplication] setIdleTimerDisabled:YES] to prevent the iPhone from shutting off the screen and going to sleep. Don't give that sucker a chance to cool down and rest!

2) Spawn a bunch of threads that each contain a tight while loop with an impossible exit condition like 0==1.

3) In each of those threads' loops, generate two large random numbers, multiply them together, then take the square root of that number. That should be plenty, once its repeated millions of times on those threads.

Shouldn't take too long for it to become noticeably warm, and should drain your battery quick

Don't blame me if you leave your iPhone plugged in running this all day and permanently damage it

--- ChronoSoft ---
Support your roguelikes! Play Rogue Touch today!
Spirit Hunter Mineko: Demons Reach --- Work in progress! Follow us on Twitter!