From c37744cde9ff9a4e9e476a9a4acebfee87650f29 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Tue, 7 Mar 2017 16:58:13 +0000 Subject: 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 --- src/drivers/WinAPI/Fl_WinAPI_System_Driver.H | 3 ++- src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'src/drivers/WinAPI') diff --git a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H index 759a39d0c..43e0f54e2 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H +++ b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H @@ -4,7 +4,7 @@ // Definition of MSWindows system driver // for the Fast Light Tool Kit (FLTK). // -// Copyright 2010-2016 by Bill Spitzak and others. +// Copyright 2010-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 @@ -116,6 +116,7 @@ public: virtual void add_fd(int fd, Fl_FD_Handler cb, void* = 0); virtual void remove_fd(int, int when); virtual void remove_fd(int); + virtual void gettime(time_t *sec, int *usec); }; #endif // FL_WINAPI_SYSTEM_DRIVER_H diff --git a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx index 43141ffae..007f73d0e 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx +++ b/src/drivers/WinAPI/Fl_WinAPI_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 @@ -31,6 +31,7 @@ #include #include #include +#include // function pointer for the UuidCreate Function // RPC_STATUS RPC_ENTRY UuidCreate(UUID __RPC_FAR *Uuid); typedef RPC_STATUS (WINAPI* uuid_func)(UUID __RPC_FAR *Uuid); @@ -902,6 +903,13 @@ const char *Fl_WinAPI_System_Driver::home_directory_name() return h; } +void Fl_WinAPI_System_Driver::gettime(time_t *sec, int *usec) { + struct _timeb t; + _ftime(&t); + *sec = t.time; + *usec = t.millitm * 1000; +} + // // End of "$Id$". // -- cgit v1.2.3