mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 19:28:57 +01:00
cede5027d3
Closes #2703
39 lines
1.0 KiB
C
39 lines
1.0 KiB
C
// SPDX-License-Identifier: Apache-2.0
|
|
// SPDX-FileCopyrightText: 2009-2016 Camilla Löwy <elmindreda@glfw.org>
|
|
// SPDX-FileCopyrightText: 2023 The Ebitengine Authors
|
|
|
|
#include "internal_unix.h"
|
|
|
|
#include <mach/mach_time.h>
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
////// GLFW internal API //////
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
// Initialise timer
|
|
//
|
|
void _glfwInitTimerNS(void)
|
|
{
|
|
mach_timebase_info_data_t info;
|
|
mach_timebase_info(&info);
|
|
|
|
_glfw.timer.ns.frequency = (info.denom * 1e9) / info.numer;
|
|
}
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
////// GLFW platform API //////
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
uint64_t _glfwPlatformGetTimerValue(void)
|
|
{
|
|
return mach_absolute_time();
|
|
}
|
|
|
|
uint64_t _glfwPlatformGetTimerFrequency(void)
|
|
{
|
|
return _glfw.timer.ns.frequency;
|
|
}
|
|
|