View previous topic :: View next topic |
Author |
Message |
educofu Expert Cheater Reputation: 3
Joined: 21 Aug 2009 Posts: 171 Location: Brazil,MG,OP
|
Posted: Tue Nov 30, 2010 11:37 am Post subject: CPU Speed tester (written in c++) + binary |
|
|
i wrote this just for fun.
Code: |
#include <iostream>
#include <time.h>
using namespace std;
int action;
int b;
int a=0;
int main ()
{
cout << "This will test your CPU current speed (in 10 seconds)\n";
while(clock ()<=10000)
{
if (a=clock())b++;
a=clock();
}
b/=100000;
cout << "\nYour CPU scored " << b << " Points.";
b*=4.3;
cout << "\nYour CPU speed is equivalent to " << b << "Mhz.";
cin >> action;
exit(0);
}
|
i got 1206 (5186Mhz) points with a Pentium Dual-Core E5400(2.7GHz x2) and 463 (1991Mhz) Points with a Semprom 2800 (2.0GHz)
binary: http://ifile.it/b8nm67t
post here yours scores and sugestions!
_________________
"I finally started thinking outside of the box, only to find myself in a larger box."
Last edited by educofu on Tue Nov 30, 2010 4:15 pm; edited 1 time in total |
|
Back to top |
|
|
92Garfield I'm a spammer Reputation: 57
Joined: 20 Dec 2007 Posts: 5871 Location: Banana Republic Germany
|
Posted: Tue Nov 30, 2010 11:50 am Post subject: |
|
|
Only uses 1 core.
AMD 64 x2 6000+
780 and 3353 Mhz
Also, what is clock()?
_________________
|
|
Back to top |
|
|
Jorg hi I post too much Reputation: 7
Joined: 24 Dec 2007 Posts: 2276 Location: Minnesota
|
Posted: Tue Nov 30, 2010 2:40 pm Post subject: |
|
|
I think clock() returns the total clock ticks elapsed since the program was launched. But what Garfield said that it only checks 1 core. And its doesn't do anything with pipelines, and its limited to the compilation of the code. But it still is decent.
My score was 883 Points/3796Mhz.
_________________
CEF will always stay alive. |
|
Back to top |
|
|
hcavolsdsadgadsg I'm a spammer Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Tue Nov 30, 2010 2:48 pm Post subject: |
|
|
this is not a very accurate representation of speed, nor a very good test since the number of times it loops (doing almost nothing) is so low
|
|
Back to top |
|
|
educofu Expert Cheater Reputation: 3
Joined: 21 Aug 2009 Posts: 171 Location: Brazil,MG,OP
|
Posted: Tue Nov 30, 2010 3:33 pm Post subject: |
|
|
slovach wrote: | this is not a very accurate representation of speed, nor a very good test since the number of times it loops (doing almost nothing) is so low |
actually i think this program is a decent test. it works like this:
start counting in ms
get the value of current time in ms
sum how many times the time is the same.
thats in 10 seconds, or 10000 ms, wich allows a good precision of results.
but what i think is that the equivalent speed in MHz shoudnt be always considered, since the constant im using (4.3) may vary according the CPU cache, ram, etc...
also just tested on a Celeron 2.53Ghz + 512 ram and got a result of 366 points and 1573 Mhz
_________________
"I finally started thinking outside of the box, only to find myself in a larger box." |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25295 Location: The netherlands
|
Posted: Tue Nov 30, 2010 5:08 pm Post subject: |
|
|
tip: make it spawn several threads (based on the total number of logical cpu's) and do the calculation in there
then count it all up for a total (spawn all threads at the same time, each thread runs infinitely , wait 10 seconds and then suspend all threads and count how many iterations each thread has done)
also, add some memory access stuff:
add "volatile" before a variable declaration to make sure it's not being optimized into a single register
or if you intend on having register only calculations leave it like this
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
Jani Grandmaster Cheater Reputation: 2
Joined: 29 Dec 2006 Posts: 804
|
Posted: Wed Dec 01, 2010 3:25 am Post subject: |
|
|
Code: | #include <iostream>
#include <ctime>
int main(int argc, char *argv[])
{
std::cout << "Clock() is already returning: " << std::endl;
std::cout << clock() << std::endl;
int a = 0;
int b;
std::cout << "b is just some random value, might not be 0: " << b << ". The compiler warns about it and 2010 CRT won't even run the app if b isn't initialized" << std::endl;
while(clock() <= 10000) {
if(a = clock()) {
std::cout << "This block is executed always" << std::endl;
b++;
}
a = clock();
}
std::cout << "What do I do with this a: " << a << std::endl;
return 0;
} |
|
|
Back to top |
|
|
Slugsnack Grandmaster Cheater Supreme Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Wed Dec 01, 2010 9:52 am Post subject: |
|
|
you do know about context switching right ?
|
|
Back to top |
|
|
educofu Expert Cheater Reputation: 3
Joined: 21 Aug 2009 Posts: 171 Location: Brazil,MG,OP
|
Posted: Fri Dec 03, 2010 12:54 pm Post subject: |
|
|
just tested on a Celerom M 900 MHz 1 gb and got 311 points (1,33 GHz), This shows i cant consider the equivalent speed.
_________________
"I finally started thinking outside of the box, only to find myself in a larger box." |
|
Back to top |
|
|
Bamases Newbie cheater Reputation: -1
Joined: 20 Jun 2009 Posts: 18
|
Posted: Mon Dec 06, 2010 12:14 pm Post subject: |
|
|
469 points fail.
|
|
Back to top |
|
|
|