HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SYS_Time.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: SYS_Time.h (SYS Library, C++)
7  *
8  * COMMENTS: Platform-independent time structures
9  */
10 
11 #ifndef __SYS_TIME_H_INCLUDED__
12 #define __SYS_TIME_H_INCLUDED__
13 
14 #include "SYS_API.h"
15 #include "SYS_Types.h"
16 
17 #ifdef WIN32
18 struct SYS_TimeVal
19 {
20  long tv_sec; /* seconds */
21  long tv_usec; /* and microseconds */
22 };
23 #else
24 
25 #include <sys/time.h>
26 
27 typedef struct timeval SYS_TimeVal;
28 
29 #endif
30 
31 // SYSgettimeofday() fills in tval with the "current" time, which cannot be
32 // given any particular meaning. These values are only useful for comparing
33 // against each other.
35 
36 // Return a number of milliseconds since the process started. This function
37 // will wrap values every 50 days or so.
38 SYS_API unsigned int SYSclock();
39 
40 // Return the number of seconds since some arbitrary start time as a real
41 // number. Returns -1 if there was an error computing the time.
43 
44 // Return the number of seconds expressed in the given time value.
45 SYS_API fpreal SYStime(const SYS_TimeVal &tval);
46 
47 #endif // __SYS_TIME_H_INCLUDED__
struct timeval SYS_TimeVal
Definition: SYS_Time.h:27
SYS_API int SYSgettimeofday(SYS_TimeVal *tval)
SYS_API unsigned int SYSclock()
SYS_API fpreal SYStime()
double fpreal
Definition: SYS_Types.h:263
#define SYS_API
Definition: SYS_API.h:11