You might want to make sure that your Android environment ends up having BOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK .
If you look at the default timer_traits in boost/asio/time_traits.hpp , you will see that if this is not defined, asio will use second_clock as its timer.
This parameter is determined from boost/date_time/compiler_config.hpp , provided BOOST_HAS_GETTIMEOFDAY or BOOST_HAS_FTIME . Given your example, you should probably define the first.
I do not know if android is considered its own platform, or if boost defines it as linux. In boost/config/platform/linux.hpp it is defined as:
//
// If glibc is past version 2 then we definitely have
// gettimeofday, earlier versions may or may not have it:
//
#if defined (__ GLIBC__) && (__GLIBC__> = 2)
# define BOOST_HAS_GETTIMEOFDAY
#endif
You probably want to add an additional condition for Android.
source share