C++ How fast is your CPU?
This tutorial shows you how to create a programm in C++ which gets the basic CPU measurement
All explanations are in the comments of the following code.
For all who never made anything in C++, but are interested:
Where to get a C++ IDE:
http://www.microsoft.com/express/vc/
(Forget the gamescreator stuff, it sucks. But feel free to test it on your own)
Create a console project.
Add the code and compile.
How to compile it on a linux system
1.Get g++ with the installer tool of your OS. (apt-get in Debian, Yast in OpenSuse...)
2.Open the terminal and compile your cpu.cpp file with this:
Download compiled .exe:
http://www.s244862283.online.de/downloads/cpu.exe
http://www.s244862283.online.de/downloads/24234_cpu.exe
Only for Linux:
http://www.s244862283.online.de/downloads/cpu
Download source:
http://pastebin.com/f30779f98
ty for reading my tutorial
post your results
This tutorial shows you how to create a programm in C++ which gets the basic CPU measurement
All explanations are in the comments of the following code.
Code:
#include <iostream>
using namespace std;
#include <time.h>
int main()
{
cout << "[themavesite.com] CPU benchmark started" << endl;
clock_t start,end;
start = clock(); //clock() gets the wasted CPU time
//At the beginning we get the starting time, because its not necessarily guarantee
//that no ticks have been counted.
for(int i=0; i<999999999;i++)
{
//some progressing stuff for the CPU
// CPU turns evil
}
end = clock(); //we get the starting time again
cout << start << endl; //prints start time in the console
cout << end << ":" << CLOCKS_PER_SEC << endl;//prints the end time and the constant
// CLOCKS_PER_SEC (1.000.000 on all POSIX-Systems)
cin.get();
}
For all who never made anything in C++, but are interested:
Where to get a C++ IDE:
http://www.microsoft.com/express/vc/
(Forget the gamescreator stuff, it sucks. But feel free to test it on your own)
Create a console project.
Add the code and compile.
How to compile it on a linux system
1.Get g++ with the installer tool of your OS. (apt-get in Debian, Yast in OpenSuse...)
2.Open the terminal and compile your cpu.cpp file with this:
Code:
g++ -o CPU cpu.cpp
Download compiled .exe:
http://www.s244862283.online.de/downloads/cpu.exe
http://www.s244862283.online.de/downloads/24234_cpu.exe
Only for Linux:
http://www.s244862283.online.de/downloads/cpu
Download source:
http://pastebin.com/f30779f98
ty for reading my tutorial
post your results