summaryrefslogtreecommitdiff
path: root/src/drivers/Posix/Fl_Posix_System_Driver.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2017-03-07 16:58:13 +0000
committerManolo Gouy <Manolo>2017-03-07 16:58:13 +0000
commitc37744cde9ff9a4e9e476a9a4acebfee87650f29 (patch)
tree69d6c215ddd231e4350371d810de04422ee16b32 /src/drivers/Posix/Fl_Posix_System_Driver.cxx
parent3c375f39775cc450e05437d09543f179ff4ccc93 (diff)
Add to Fl_System_Driver support for measuring time with split second resolution.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12187 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/Posix/Fl_Posix_System_Driver.cxx')
-rw-r--r--src/drivers/Posix/Fl_Posix_System_Driver.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/drivers/Posix/Fl_Posix_System_Driver.cxx b/src/drivers/Posix/Fl_Posix_System_Driver.cxx
index 9fb0fc5cd..c2576b268 100644
--- a/src/drivers/Posix/Fl_Posix_System_Driver.cxx
+++ b/src/drivers/Posix/Fl_Posix_System_Driver.cxx
@@ -3,7 +3,7 @@
//
// Definition of Apple Darwin system driver.
//
-// Copyright 1998-2016 by Bill Spitzak and others.
+// Copyright 1998-2017 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -30,6 +30,7 @@
#endif
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/time.h>
#include <pwd.h>
#include <unistd.h>
#include <time.h>
@@ -90,6 +91,14 @@ const char *Fl_Posix_System_Driver::getpwnam(const char *login) {
return pwd ? pwd->pw_dir : NULL;
}
+
+void Fl_Posix_System_Driver::gettime(time_t *sec, int *usec) {
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+ *sec = tv.tv_sec;
+ *usec = tv.tv_usec;
+}
+
//
// End of "$Id$".
//