Revision 762

branches/threaded2/tests/threaded_hessian_routine/tests_threaded_hessian_routine.cpp (revision 762)
2 2
#include <vector>
3 3
#include <thread>
4 4
#include <functional>
5
#include <chrono>
6
#include <ctime>
5 7
using std::vector;
6 8
using std::thread;
7 9
using std::function;
......
1303 1305
  mp.iprint=10;
1304 1306
  mp.preliminary_calculations();
1305 1307
  mp.minimize();
1308

  
1309
  std::chrono::time_point<std::chrono::system_clock> start, end;
1310
  start = std::chrono::system_clock::now();
1306 1311
  mp.hess_routine_noparallel();
1312
  end = std::chrono::system_clock::now();
1313
  int elapsed = std::chrono::duration_cast<std::chrono::nanoseconds>(end-start).count();
1314
  cout << elapsed << endl;
1307 1315

  
1308 1316
  delete initial_params::varsptr;
1309 1317
  initial_params::varsptr = nullptr;
......
1377 1385
    sdelta4 -= d3x(i, 4, i);
1378 1386
    d3x(i, 4, i) = dv(i) + sdelta4;
1379 1387
  }
1388
  std::chrono::time_point<std::chrono::system_clock> start, end;
1389
  start = std::chrono::system_clock::now();
1380 1390
  vector<thread> threads;
1381 1391
  for (int i = 1; i <= nvar; i++)
1382 1392
  {
......
1389 1399
  {
1390 1400
    thread.join();
1391 1401
  }
1402
  end = std::chrono::system_clock::now();
1403
  int elapsed = std::chrono::duration_cast<std::chrono::nanoseconds>(end-start).count();
1404
  cout << elapsed << endl;
1405

  
1392 1406
  ASSERT_EQ(nullptr, initial_params::varsptr);
1393 1407
  dvector hess(1, nvar);
1394 1408
  hess.initialize();

Also available in: Unified diff