diff options
author | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2020-04-20 16:37:24 +0300 |
---|---|---|
committer | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2020-04-20 19:03:46 +0300 |
commit | ee1d700a9bc764c86502978b5538df44aaa66905 (patch) | |
tree | eee57715e5963a0057ce77ae44143615c3257f93 /include/mbgl/platform/time.hpp | |
parent | 71ce52d35f8421c89f6112b83061613937b2836c (diff) | |
download | qtlocation-mapboxgl-ee1d700a9bc764c86502978b5538df44aaa66905.tar.gz |
[core] Add platform abstractions for utils::now()
Some platforms might require special permissions or custom APIs
to access the current time of the day.
Diffstat (limited to 'include/mbgl/platform/time.hpp')
-rw-r--r-- | include/mbgl/platform/time.hpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/mbgl/platform/time.hpp b/include/mbgl/platform/time.hpp new file mode 100644 index 0000000000..8769524514 --- /dev/null +++ b/include/mbgl/platform/time.hpp @@ -0,0 +1,13 @@ +#pragma once + +#include <chrono> + +namespace mbgl { +namespace platform { + +// Returns the current time. Abstracted because some platforms +// will not allow direct access to the current time via syscall. +std::chrono::time_point<std::chrono::system_clock, std::chrono::seconds> now(); + +} // namespace platform +} // namespace mbgl |