aboutsummaryrefslogtreecommitdiff
path: root/src/gensvm_timer.c
blob: 04d93b114f1c8837ec827596a0eded36fcdac660 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/**
 * @file timer.c
 * @author Gertjan van den Burg
 * @date January, 2014
 * @brief Utility functions relating to time
 *
 * @details
 * This file contains a simple function for calculating the time in seconds
 * elapsed between two clock() calls.
 *
 */

#include "gensvm_timer.h"

/**
 * @brief Calculate the time between two clocks
 *
 * @param[in] 	s_time 	starting time
 * @param[in] 	e_time 	end time
 * @returns 		time elapsed in seconds
 */
double gensvm_elapsed_time(clock_t s_time, clock_t e_time)
{
	return ((double) (e_time - s_time))/((double) CLOCKS_PER_SEC);
}