/* * Copyright (c) 2020, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include namespace Web::HighResolutionTime { class Performance final : public DOM::EventTarget { WEB_PLATFORM_OBJECT(Performance, DOM::EventTarget); public: virtual ~Performance() override; double now() const { return m_timer.elapsed(); } double time_origin() const; JS::GCPtr timing(); private: explicit Performance(HTML::Window&); virtual void visit_edges(Cell::Visitor&) override; JS::NonnullGCPtr m_window; JS::GCPtr m_timing; Core::ElapsedTimer m_timer; }; }