HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 #include <time.h>
17 
18 #ifdef WIN32
19 struct SYS_TimeVal
20 {
21  exint tv_sec; /* seconds */
22  exint tv_usec; /* and microseconds */
23 };
24 #else
25 
26 #include <sys/time.h>
27 
28 typedef struct timeval SYS_TimeVal;
29 
30 #endif
31 
32 // SYSgettimeofday() fills in tval with the "current" time, which cannot be
33 // given any particular meaning. These values are only useful for comparing
34 // against each other.
36 
37 // Return a number of milliseconds since the process started. This function
38 // will wrap values every 50 days or so.
39 SYS_API time_t SYSclock();
40 
41 // Return the number of seconds since some arbitrary start time as a real
42 // number. Returns -1 if there was an error computing the time.
44 
45 // Return the number of seconds expressed in the given time value.
46 SYS_API fpreal SYStime(const SYS_TimeVal &tval);
47 
48 /// Return the system resource usage times (user and system) for the current
49 /// process.
50 SYS_API void SYSrusage(SYS_TimeVal &user, SYS_TimeVal &sys);
51 
52 #endif // __SYS_TIME_H_INCLUDED__
struct timeval SYS_TimeVal
Definition: SYS_Time.h:28
int64 exint
Definition: SYS_Types.h:125
SYS_API int SYSgettimeofday(SYS_TimeVal *tval)
SYS_API time_t SYSclock()
SYS_API void SYSrusage(SYS_TimeVal &user, SYS_TimeVal &sys)
SYS_API fpreal SYStime()
fpreal64 fpreal
Definition: SYS_Types.h:277
#define SYS_API
Definition: SYS_API.h:11