Dynamic protocols.

This commit is contained in:
Christoffer Lerno
2023-10-04 23:10:59 +02:00
committed by Christoffer Lerno
parent 4cc30c0d33
commit 49c4595457
106 changed files with 2372 additions and 2011 deletions

View File

@@ -1,9 +1,9 @@
module std::time;
def Time = distinct long @inline;
def Duration = distinct long @inline;
def Clock = distinct ulong @inline;
def NanoDuration = distinct long @inline;
def Time = distinct long;
def Duration = distinct long;
def Clock = distinct ulong;
def NanoDuration = distinct long;
const Duration MS = 1_000;
const Duration SEC = 1_000_000;
@@ -97,7 +97,7 @@ fn Duration NanoDuration.to_duration(nd) => (Duration)nd / 1_000;
fn NanoDuration Duration.to_nano(td) => (NanoDuration)td * 1_000;
fn long Duration.to_ms(td) => (long)td / 1_000;
fn usz! NanoDuration.to_format(&self, Formatter* formatter) @dynamic
fn usz! NanoDuration.to_format(&self, Formatter* formatter) : Printable
{
NanoDuration nd = *self;
if (nd == 0)