Device vs. Sim

0 views
Skip to first unread message

DavidK

unread,
May 13, 2009, 12:45:57 PM5/13/09
to RTFM: Development for Mobile Devices
If anyone is interested in publishing their application, this might be
useful information.

1. The simulator runs about 10x the speed of the device on my unibody
MacBook. I've heard numbers as low as 2x, but that is not realistic
for me. To figure out how long some code takes, wrap it in this:

clock_t start, end;
double elapsed;
start = clock();
//time me

//done
end = clock();
elapsed = ((double) (end - start)) / CLOCKS_PER_SEC;
NSLog(@"Time: %f",elapsed);

Multiply by 10 to get time on the actual device. No guarantees about
that number.

2. You get about 20 megabytes of RAM to work with. To find out how
much your application uses, build it, then choose Run > Start with
Performance Tool > Object Allocations. You will get a graph of memory
usage over time. Drag the carat above the graph to see a precise
number at a given time.
Reply all
Reply to author
Forward
0 new messages