mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 20:11:17 +00:00
13 lines
293 B
Plaintext
13 lines
293 B
Plaintext
module std::time::os @if(env::DARWIN);
|
|
import std::os::darwin;
|
|
|
|
fn Clock native_clock()
|
|
{
|
|
static Darwin_mach_timebase_info_data_t timebase;
|
|
if (!timebase.denom)
|
|
{
|
|
darwin::mach_timebase_info(&timebase);
|
|
}
|
|
return (Clock)(darwin::mach_absolute_time() * timebase.numer / timebase.denom);
|
|
}
|