MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
clock_time.cc File Reference
#include <ctime>
#include "mbconfig.h"
#include "clock_time.h"
Include dependency graph for clock_time.cc:

Go to the source code of this file.

Functions

double mbdyn_clock_time ()
 

Function Documentation

double mbdyn_clock_time ( )

Definition at line 51 of file clock_time.cc.

References c.

Referenced by cppad_benchmark1(), cppad_benchmark2(), cppad_benchmark3(), Mat3xN_test(), Mat3xN_test_grad(), Mat3xNT_test_grad(), MatDynamic_test(), MatDynamic_test_grad(), MatDynamicT_test(), MatDynamicT_test_grad(), MatNxN_test(), MatNxN_test_grad(), MatNxNT_test_grad(), NewtonRaphsonSolver::Solve(), LineSearchSolver::Solve(), testMatVecProductGradient2(), testVecOp(), tic(), and toc().

51  {
52 #if defined(WIN32) || defined(__CYGWIN__)
53  LARGE_INTEGER c, f;
54  QueryPerformanceFrequency(&f);
55  QueryPerformanceCounter(&c);
56  return static_cast<double>(c.QuadPart) / f.QuadPart;
57 #elif defined(HAVE_CLOCK_GETTIME)
58  timespec tp;
59  clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &tp);
60  return (tp.tv_sec + 1e-9 * tp.tv_nsec);
61 #else
62  return static_cast<double>(clock())/CLOCKS_PER_SEC;
63 #endif
64 }
static std::stack< cleanup * > c
Definition: cleanup.cc:59