The code behind Hand Heater app?

Discussion in 'Public Game Developers Forum' started by AdamsApple, Mar 11, 2011.

  1. AdamsApple

    AdamsApple New Member

    Mar 11, 2011
    1
    0
    0
    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.
     
  2. CommanderData

    CommanderData Well-Known Member
    Patreon Indie

    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 :D

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

Share This Page