Updated timing script
parent
f5b57ce59f
commit
a573658ba4
|
@ -26,16 +26,16 @@ using namespace gtsam;
|
|||
#define TEST(TITLE, STATEMENT) \
|
||||
cout << endl << TITLE << endl; \
|
||||
timeLog = clock(); \
|
||||
for(int i = 0; i < n; i++)\
|
||||
STATEMENT;\
|
||||
for (int i = 0; i < n; i++) STATEMENT; \
|
||||
timeLog2 = clock(); \
|
||||
seconds = (double)(timeLog2-timeLog)/CLOCKS_PER_SEC;\
|
||||
cout << seconds << " seconds" << endl;\
|
||||
cout << ((double)n/seconds) << " calls/second" << endl;
|
||||
seconds = static_cast<double>(timeLog2 - timeLog) / CLOCKS_PER_SEC; \
|
||||
cout << 1000 * seconds << " milliseconds" << endl; \
|
||||
cout << (1e9 * seconds / static_cast<double>(n)) << " nanosecs/call" << endl;
|
||||
|
||||
int main()
|
||||
{
|
||||
int n = 100000; long timeLog, timeLog2; double seconds;
|
||||
int main() {
|
||||
int n = 100000;
|
||||
clock_t timeLog, timeLog2;
|
||||
double seconds;
|
||||
// create a random direction:
|
||||
double norm = sqrt(1.0 + 16.0 + 4.0);
|
||||
double x = 1.0 / norm, y = 4.0 / norm, z = 2.0 / norm;
|
||||
|
|
Loading…
Reference in New Issue