// ******************************************************************* // (C) Copyright 2013 Leiden Institute of Advanced Computer Science // Universiteit Leiden // All Rights Reserved // ******************************************************************* // Dou Shou Qi (engine) // ******************************************************************* // FILE INFORMATION: // File: timer.h // Author: Jonathan K. Vis // Revision: 1.01a // Date: 2013/04/05 // ******************************************************************* // DESCRIPTION: // Timer functions. // ******************************************************************* #if !defined(__timer_h__) #define __timer_h__ #include static int clock_start; static inline void tic(void) { return static_cast(clock_start = std::clock()); } // tic static inline int toc(void) { return static_cast(std::clock() - clock_start); } // toc static inline double seconds(int const clock_count) { return static_cast(clock_count) / static_cast(CLOCKS_PER_SEC); } // seconds #endif