Repository: qpid-proton Updated Branches: refs/heads/master e6aaadb21 -> 6f88f525e
PROTON-1471: [C++ binding] Use pn_proactor_now() to implement timestamp::now() Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/6f88f525 Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/6f88f525 Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/6f88f525 Branch: refs/heads/master Commit: 6f88f525e8800f6cbbba5c0a6cacf1d059176ef2 Parents: f6d4648 Author: Andrew Stitcher <[email protected]> Authored: Thu Apr 27 13:05:14 2017 -0400 Committer: Andrew Stitcher <[email protected]> Committed: Fri Jul 21 12:50:06 2017 -0400 ---------------------------------------------------------------------- proton-c/bindings/cpp/src/timestamp.cpp | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/6f88f525/proton-c/bindings/cpp/src/timestamp.cpp ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/src/timestamp.cpp b/proton-c/bindings/cpp/src/timestamp.cpp index da7c49f..437276e 100644 --- a/proton-c/bindings/cpp/src/timestamp.cpp +++ b/proton-c/bindings/cpp/src/timestamp.cpp @@ -20,29 +20,16 @@ #include "proton/timestamp.hpp" #include "proton/internal/config.hpp" +#include <proton/proactor.h> #include <proton/types.h> #include <iostream> -#if PN_CPP_HAS_CHRONO -#include <chrono> -#else -#include <time.h> -#endif - namespace proton { -#if PN_CPP_HAS_CHRONO -timestamp timestamp::now() { - using namespace std::chrono; - return timestamp( duration_cast<std::chrono::milliseconds>(system_clock::now().time_since_epoch()).count() ); -} -#else -// Fallback with low (seconds) precision timestamp timestamp::now() { - return timestamp( time(0)*1000 ); + return timestamp( pn_proactor_now() ); } -#endif std::ostream& operator<<(std::ostream& o, timestamp ts) { return o << ts.milliseconds(); } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
