Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/neutrinolabs/NeutrinoRDP.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Sorg <jay.sorg@gmail.com>2014-01-11 09:53:41 +0400
committerJay Sorg <jay.sorg@gmail.com>2014-01-11 09:53:41 +0400
commit1429dc1b3cb4fd1e8871b4ff1aa1ef7e2fadc2c9 (patch)
tree8732e68213686566ee697be89deb765b890dc88e
parent0fc0193d8247048d03097ed18552fa2b260ba52b (diff)
added freerdp_get_mstime
-rw-r--r--include/freerdp/utils/sleep.h1
-rw-r--r--libfreerdp-utils/sleep.c13
2 files changed, 14 insertions, 0 deletions
diff --git a/include/freerdp/utils/sleep.h b/include/freerdp/utils/sleep.h
index a3650cc..8af53ff 100644
--- a/include/freerdp/utils/sleep.h
+++ b/include/freerdp/utils/sleep.h
@@ -25,5 +25,6 @@
FREERDP_API void freerdp_sleep(uint32 seconds);
FREERDP_API void freerdp_usleep(uint32 useconds);
+FREERDP_API unsigned int freerdp_get_mstime(void);
#endif /* __SLEEP_UTILS_H */
diff --git a/libfreerdp-utils/sleep.c b/libfreerdp-utils/sleep.c
index 3612fb5..9b78d68 100644
--- a/libfreerdp-utils/sleep.c
+++ b/libfreerdp-utils/sleep.c
@@ -17,6 +17,11 @@
* limitations under the License.
*/
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/time.h>
+
#include <freerdp/utils/sleep.h>
#include <time.h>
@@ -56,3 +61,11 @@ void freerdp_usleep(uint32 useconds)
while ((t2 - t1) < useconds);
#endif
}
+
+unsigned int freerdp_get_mstime(void)
+{
+ struct timeval tp;
+
+ gettimeofday(&tp, 0);
+ return (tp.tv_sec * 1000) + (tp.tv_usec / 1000);
+}