Voici le fichier main_PVector.cpp :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#include <iostream>
#include <time.h>
#include "PVector.h"
using namespace std;
int main() {
PVector v1, v2, v3, v4;
v1.setValue(1.0);
v2.setValue(1.0);
v3.setValue(1.0);
clock_t beginTime = clock();
for(size_t i(0); i < 1000; ++i){
v4 = 1.0 * (v1 / 2.0) - (v2 + v3) * 2.0;
}
cout << "Elapsed time PVector : " << ((float)(clock() - beginTime))/CLOCKS_PER_SEC << " s" << endl;
return 0;
}
|
|