diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2024-03-06 10:24:46 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2024-03-06 10:24:46 +0100 |
commit | 372a0e99c2f61543d9e14d9933b59d9d1f4cb26e (patch) | |
tree | bbadf39aed0610c8f8f7b41fefff47773b8ac205 /xsd/examples/cxx/tree/performance/time.cxx | |
parent | 23d41842168ac1a1580111b9c5c73500ceee3d57 (diff) | |
parent | 4538829ab86b5a1cd4e845e7eab165029c9d6d46 (diff) |
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'xsd/examples/cxx/tree/performance/time.cxx')
-rw-r--r-- | xsd/examples/cxx/tree/performance/time.cxx | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/xsd/examples/cxx/tree/performance/time.cxx b/xsd/examples/cxx/tree/performance/time.cxx deleted file mode 100644 index 6bec91b..0000000 --- a/xsd/examples/cxx/tree/performance/time.cxx +++ /dev/null @@ -1,46 +0,0 @@ -// file : examples/cxx/tree/performance/time.cxx -// copyright : not copyrighted - public domain - -#include "time.hxx" - -#if defined (WIN32) || defined (__WIN32__) -# define WIN32_LEAN_AND_MEAN -# include <windows.h> // GetSystemTimeAsFileTime -#else -# include <time.h> // gettimeofday -# include <sys/time.h> // timeval -#endif - -#include <ostream> // std::ostream -#include <iomanip> // std::setfill, std::setw - -namespace os -{ - time:: - time () - { -#if defined (WIN32) || defined (__WIN32__) - FILETIME ft; - GetSystemTimeAsFileTime (&ft); - unsigned long long v ( - ((unsigned long long) (ft.dwHighDateTime) << 32) + ft.dwLowDateTime); - - sec_ = static_cast<unsigned long> (v / 10000000ULL); - nsec_ = static_cast<unsigned long> ((v % 10000000ULL) * 100); -#else - timeval tv; - if (gettimeofday(&tv, 0) != 0) - throw failed (); - - sec_ = static_cast<unsigned long> (tv.tv_sec); - nsec_ = static_cast<unsigned long> (tv.tv_usec * 1000); -#endif - } - - std::ostream& - operator<< (std::ostream& o, time const& t) - { - return o << t.sec () << '.' - << std::setfill ('0') << std::setw (9) << t.nsec (); - } -} |