Robotran C Documentation
time_functions.h
Go to the documentation of this file.
1 
7 #ifdef REAL_TIME
8 
9 #ifndef _TIME_FUNCTIONS_H_
10 #define _TIME_FUNCTIONS_H_
11 
12 #include <stdlib.h>
13 
14 #ifdef UNIX
15  #include <sys/time.h>
16 #else
17  #include <time.h>
18  #include <sys/timeb.h>
19 
20 typedef struct timeval {
21  long tv_sec;
22  long tv_usec;
23 } timeval;
24 #endif
25 
26 // prototypes
27 void time_get(int *t_sec, int *t_usec);
28 int t_usec(int init_t_sec, int init_t_usec);
29 
30 #ifndef UNIX
31 int gettimeofday (struct timeval *tp, void *tz);
32 #endif
33 
34 #endif
35 #endif
timeval::tv_usec
long tv_usec
Definition: time_functions.h:22
t_usec
int t_usec(int init_t_sec, int init_t_usec)
return the elapsed time (in us) since time 'init_t' (expressed in s and us)
Definition: time_functions.c:25
time_get
void time_get(int *t_sec, int *t_usec)
return the absolute time of the computer
Definition: time_functions.c:11
timeval::tv_sec
long tv_sec
Definition: time_functions.h:21
time_functions.h
functions used to get the time expressed in us (micro seconds)
gettimeofday
int gettimeofday(struct timeval *tp, void *tz)
get current time fot Windows
Definition: time_functions.c:36
t_usec
int t_usec(int init_t_sec, int init_t_usec)
return the elapsed time (in us) since time 'init_t' (expressed in s and us)
Definition: time_functions.c:25
time_get
void time_get(int *t_sec, int *t_usec)
return the absolute time of the computer
Definition: time_functions.c:11
timeval
Definition: time_functions.h:20
gettimeofday
int gettimeofday(struct timeval *tp, void *tz)
get current time fot Windows
Definition: time_functions.c:36