summaryrefslogtreecommitdiff
path: root/pjlib/src/pj/os_timestamp_win32.c
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2005-10-31 21:02:30 +0000
committerBenny Prijono <bennylp@teluu.com>2005-10-31 21:02:30 +0000
commitb5a1af6f999820564ead4867b1e5d5574778ee56 (patch)
tree8323d870699994f8b75001f961fd5e1780c0f76a /pjlib/src/pj/os_timestamp_win32.c
initial import
git-svn-id: http://svn.pjsip.org/repos/pjproject/main@1 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/src/pj/os_timestamp_win32.c')
-rw-r--r--pjlib/src/pj/os_timestamp_win32.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/pjlib/src/pj/os_timestamp_win32.c b/pjlib/src/pj/os_timestamp_win32.c
new file mode 100644
index 00000000..787c4bfc
--- /dev/null
+++ b/pjlib/src/pj/os_timestamp_win32.c
@@ -0,0 +1,38 @@
+/* $Header: /pjproject-0.3/pjlib/src/pj/os_timestamp_win32.c 2 10/14/05 12:26a Bennylp $ */
+/*
+ * $Log: /pjproject-0.3/pjlib/src/pj/os_timestamp_win32.c $
+ *
+ * 2 10/14/05 12:26a Bennylp
+ * Finished error code framework, some fixes in ioqueue, etc. Pretty
+ * major.
+ *
+ * 1 9/18/05 8:15p Bennylp
+ * Created.
+ *
+ */
+#include <pj/os.h>
+#include <pj/errno.h>
+#include <windows.h>
+
+PJ_DEF(pj_status_t) pj_get_timestamp(pj_timestamp *ts)
+{
+ LARGE_INTEGER val;
+
+ if (!QueryPerformanceCounter(&val))
+ return PJ_RETURN_OS_ERROR(GetLastError());
+
+ ts->u64 = val.QuadPart;
+ return PJ_SUCCESS;
+}
+
+PJ_DEF(pj_status_t) pj_get_timestamp_freq(pj_timestamp *freq)
+{
+ LARGE_INTEGER val;
+
+ if (!QueryPerformanceFrequency(&val))
+ return PJ_RETURN_OS_ERROR(GetLastError());
+
+ freq->u64 = val.QuadPart;
+ return PJ_SUCCESS;
+}
+