#include "flutter/fml/time/time_point.h"
#include "flutter/fml/build_config.h"
#if defined(OS_FUCHSIA)
#include <zircon/syscalls.h>
#else
#include <chrono>
#endif
namespace fml {
#if defined(OS_FUCHSIA)
TimePoint TimePoint::Now() {
return TimePoint(zx_clock_get_monotonic());
}
#else
TimePoint TimePoint::Now() {
#ifdef WINDOWS_PLATFORM
const auto elapsed_time = std::chrono::system_clock::now().time_since_epoch();
#else
const auto elapsed_time = std::chrono::steady_clock::now().time_since_epoch();
#endif
return TimePoint(
std::chrono::duration_cast<std::chrono::nanoseconds>(elapsed_time)
.count());
}
#endif
}