summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/util/u_time.c
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2008-09-11 18:32:05 +0100
committerKeith Whitwell <keith@tungstengraphics.com>2008-09-11 18:32:05 +0100
commitcc7dd4fc1b3c765ca1ecd943d189bb156dae529d (patch)
tree1a3560eb6df8a443c4f0e5af0a916f190b1542f6 /src/gallium/auxiliary/util/u_time.c
parent685248bea1fef5fd6335982570e34d0f6672030d (diff)
parentd50d68a1c940ed9c8d8c65e8e33667fa90d5baa1 (diff)
Merge commit 'origin/gallium-0.1' into gallium-0.2
Conflicts: Makefile progs/demos/Makefile progs/glsl/Makefile progs/redbook/Makefile progs/samples/Makefile progs/tests/Makefile progs/trivial/Makefile progs/xdemos/Makefile src/gallium/Makefile src/mesa/main/attrib.c src/mesa/main/bufferobj.c src/mesa/vbo/vbo_exec_draw.c
Diffstat (limited to 'src/gallium/auxiliary/util/u_time.c')
-rw-r--r--src/gallium/auxiliary/util/u_time.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_time.c b/src/gallium/auxiliary/util/u_time.c
index 49dce75289..bf7d1d1c8d 100644
--- a/src/gallium/auxiliary/util/u_time.c
+++ b/src/gallium/auxiliary/util/u_time.c
@@ -136,6 +136,26 @@ util_time_diff(const struct util_time *t1,
}
+
+uint64_t
+util_time_micros( void )
+{
+ struct util_time t1;
+
+ util_time_get(&t1);
+
+#if defined(PIPE_OS_LINUX)
+ return t1.tv.tv_usec + t1.tv.tv_sec*1000000LL;
+#elif defined(PIPE_SUBSYSTEM_WINDOWS_DISPLAY) || defined(PIPE_SUBSYSTEM_WINDOWS_USER) || defined(PIPE_SUBSYSTEM_WINDOWS_CE)
+ util_time_get_frequency();
+ return t1.counter*INT64_C(1000000)/frequency;
+#elif defined(PIPE_SUBSYSTEM_WINDOWS_MINIPORT)
+ return t1.counter/10;
+#endif
+}
+
+
+
/**
* Compare two time values.
*