]> AND Private Git Repository - Cipher_code.git/blob - IDA_new/jerasure/include/timing.h
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
add
[Cipher_code.git] / IDA_new / jerasure / include / timing.h
1 // Timing measurement utilities.
2
3 #ifndef JERASURE_INCLUDED__TIMING_H
4 #define JERASURE_INCLUDED__TIMING_H
5
6 // Define USE_CLOCK to use clock(). Otherwise use gettimeofday().
7 #define USE_CLOCK
8
9 #ifdef USE_CLOCK
10 #include <time.h>
11 #else
12 #include <sys/time.h>
13 #endif
14
15 struct timing {
16 #ifdef USE_CLOCK
17   clock_t clock;
18 #else
19   struct timeval tv;
20 #endif
21 };
22
23 // Get the current time as a double in seconds.
24 double
25 timing_now(
26   void);
27
28 // Set *t to the current time.
29 void
30 timing_set(
31   struct timing * t);
32
33 // Get *t as a double in seconds.
34 double
35 timing_get(
36   struct timing * t);
37
38 // Return *t2 - *t1 as a double in seconds.
39 double
40 timing_delta(
41   struct timing * t1,
42   struct timing * t2);
43 #endif