|
Voici le fichier main_Vector.cpp :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#include <iostream>
#include <time.h>
#include "Vector.h"
using namespace std;
int main() {
size_t size = 5000 ;
Vector v1(size, 1.0), v2(size, 1.0), v3(size, 1.0), v4(size);
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 Vector : " << ((float)(clock() - beginTime))/CLOCKS_PER_SEC << " s" << endl;
return 0;
}
|
|
|