#include <pch.hpp>

#include <core/time.hpp>
#include <chrono>

namespace OpenEngine {
    std::unique_ptr<Time> Time::instance = nullptr;

    void Time::Update()
    {
        std::chrono::high_resolution_clock::time_point current_frame
            = std::chrono::high_resolution_clock::now();

        instance->delta_time = (current_frame - instance->previous_frame);
        instance->previous_frame = current_frame;
    }
}
