cpu and bus speed report
3 posters
cpu and bus speed report
Apparently 1st and 2nd gen touch devices have different cpu and bus speeds: 412Mhz cpu with 103Mhz bus and 532Mhz cpu with 133Mhz bus respectively.
During init sio2 gives a bit of a report. Here is some code for cpu and bus speeds that might be of use to someone.
During init sio2 gives a bit of a report. Here is some code for cpu and bus speeds that might be of use to someone.
- Code:
#include <sys/sysctl.h>
int mib[6] = { 0 };
size_t length = sizeof( int );
int cpuF = 0;
int busF = 0;
// Get cpu speed
mib[0] = CTL_HW;
mib[1] = HW_CPU_FREQ;
sysctl( mib, 2, &cpuF, &length, 0,0 );
// Get bus speed
mib[0] = CTL_HW;
mib[1] = HW_BUS_FREQ;
sysctl( mib, 2, &busF, &length, 0,0 );
printf( "\nCPU speed: %d Mhz\n", cpuF/1000000 );
printf( "Bus speed: %d Mhz\n", busF/1000000 );
zzajin- Posts : 81
Join date : 2008-10-14
Re: cpu and bus speed report
Once again tks for the tip man! Will integrate the code at init time
Cheers,
Cheers,
Re: cpu and bus speed report
Then it would be probably nice to have information about available memory, too. I dump this information every five seconds in debug build just to have an idea where the memory goes even when not explicitly hunting for memory leaks.
Best,
Matt
- Code:
int pagesize;
mib[ 0 ] = CTL_HW;
mib[ 1 ] = HW_PAGESIZE;
size_t length = sizeof(pagesize);
if( sysctl( mib, 2, &pagesize, &length, NULL, 0 ) < 0 ) {
// Failure!
return;
}
mach_msg_type_number_t count = HOST_VM_INFO_COUNT;
vm_statistics_data_t vmstat;
if( host_statistics( mach_host_self(), HOST_VM_INFO, (host_info_t) &vmstat, &count ) != KERN_SUCCESS ) {
// Failure!
return;
}
NSLog( @"Free memory: %8d bytes", vmstat.free_count * pagesize );
Best,
Matt
Re: cpu and bus speed report
For memory leaks, you can use instruments, or sio2_memory, that will detect and report you the leaks as well as where in your code this memory have been initialized and the total memory currently in use...
Cheers,
Cheers,
Similar topics
» Bug Report - Camera IPO with no rotation
» iPhone 3D CPU & Bus Speed
» Collision with high speed object (ccd)
» iPhone 3D CPU & Bus Speed
» Collision with high speed object (ccd)
Permissions in this forum:
You cannot reply to topics in this forum