File: TimeUtil.h

package info (click to toggle)
libjboss-profiler-java 1.0.CR4-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze, wheezy
  • size: 376 kB
  • ctags: 488
  • sloc: cpp: 2,713; java: 1,394; xml: 169; sh: 158; makefile: 95
file content (42 lines) | stat: -rw-r--r-- 612 bytes parent folder | download | duplicates (2)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef TIMEUTIL_H_
#define TIMEUTIL_H_

#include <jni.h>
#ifdef WINDOWS
#include <windows.h>
#include <process.h>
#else
#include <unistd.h>
#include <sys/time.h>
#endif



/** Use one TimeUtil per thread. This is not thread safe as there is no synchronization on this class */
class TimeUtil
{
public:
	TimeUtil();
	virtual ~TimeUtil();

	void sysTimeMillis(jlong &currentTime);
	inline jlong sysTimeMillis()
	{
		jlong retTime;
		sysTimeMillis(retTime);
		return retTime;
	}
	
	
private:
#ifdef WINDOWS
	    SYSTEMTIME st0;
	    FILETIME   ft0;
#else
	    struct timeval t;
#endif


};

#endif /*TIMEUTIL_H_*/