Raspberry Pis Counting Up To 1 Million

Ok. Using this simple C code:-
#include <stdio.h>
void main(void)
int count;
// Display the numbers 1 through 10
for(count = 1; count <= 10; count++)
printf(“%d “, count);
and running on Pi Model B – 512MB memory using time command displays these results:-
real 3m59.801s
user 0m12.210s
sys 1m5.940s (so it took just under 4 mins in real time to reach a million).

On Pi2 – 1GB memory using time command displays:-
real 0m10.654s
user 0m2.380s
sys 0m8.000s (so it took a little over 10 seconds!).
Clearly one must take into account the CPU speed which on Pi2 is 900MHz quad-core compared to 700MHz with a floating point.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s