// Copyright (c) 2013-2021 mogemimi. Distributed under the MIT license.

#include "TimeSourceEmscripten.hpp"
#include <emscripten.h>

namespace Pomdog::Detail::Emscripten {

TimePoint TimeSourceEmscripten::Now() const
{
    const auto now = ::emscripten_get_now();
    return TimePoint{Duration{static_cast<double>(now)}};
}

} // namespace Pomdog::Detail::Emscripten

// Copyright (c) 2013-2021 mogemimi. Distributed under the MIT license.

#include "TimeSourceEmscripten.hpp"
#include <emscripten.h>
#include <type_traits>

namespace Pomdog::Detail::Emscripten {

TimePoint TimeSourceEmscripten::Now() const
{
    const auto now = ::emscripten_get_now();
    static_assert(std::is_same_v<std::remove_const_t<decltype(now)>, double>);
    return TimePoint{Duration{now * 0.001}};
}

} // namespace Pomdog::Detail::Emscripten

Fix time source for emscripten
Fix time source for emscripten
