Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect iPhone CPU speed?

Tags:

iphone

cpu

I have an aesthetic UI element, a reflection, that works well on the iPhone 3Gs and iPod Touches, but is too slow on the 3G and prior. How best can I detect CPU speed so I can disable this function?

like image 318
mahboudz Avatar asked Dec 13 '22 02:12

mahboudz


2 Answers

Instead of trying to detect speed, you could find out what model of iPhone or iPod Touch your application is running on, and then disable the function if it is not an accepted iPhone/iPod type.

To do this, you could add the following to your application:

#import <sys/utsname.h>

- (NSString *) machineModel {
    struct utsname systemInfo;
    uname (&systemInfo);
    return [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding];
}

Calling NSLog(@"Type: %@", [self machineModel]) will give you the hardware model.

like image 93
Alex Reynolds Avatar answered Jan 03 '23 10:01

Alex Reynolds


See this post: http://www.iphonedevsdk.com/forum/iphone-sdk-development/4960-how-identify-device-user.html#post111621

I think that'll give you exactly what you are looking for.

like image 40
Zoran Simic Avatar answered Jan 03 '23 09:01

Zoran Simic