diff options
| author | tgschultz <tgschultz@gmail.com> | 2018-04-18 17:43:35 -0500 |
|---|---|---|
| committer | tgschultz <tgschultz@gmail.com> | 2018-04-18 17:43:35 -0500 |
| commit | 7cfe328a16ef0d1436d8eb37980d6ebf6908a0d8 (patch) | |
| tree | 94043146d9fcf4a56d00c8ac83119651c34c6195 /std | |
| parent | bf9cf28322bf19aef72cbc5876e2ca083f762d7c (diff) | |
| download | zig-7cfe328a16ef0d1436d8eb37980d6ebf6908a0d8.tar.gz zig-7cfe328a16ef0d1436d8eb37980d6ebf6908a0d8.zip | |
fixed typos.
Diffstat (limited to 'std')
| -rw-r--r-- | std/os/linux/index.zig | 2 | ||||
| -rw-r--r-- | std/os/time.zig | 20 |
2 files changed, 11 insertions, 11 deletions
diff --git a/std/os/linux/index.zig b/std/os/linux/index.zig index dff91a500d..d37cfdcf91 100644 --- a/std/os/linux/index.zig +++ b/std/os/linux/index.zig @@ -511,7 +511,7 @@ pub fn gettimeofday(tv: &timeval, tz: &timezone) usize { return syscall2(SYS_gettimeofday, @ptrToInt(tv), @ptrToInt(tz)); } -pub fn settimeofdat(tv: &const timeval, tz: &const timezone) usize { +pub fn settimeofday(tv: &const timeval, tz: &const timezone) usize { return syscall2(SYS_settimeofday, @ptrToInt(tv), @ptrToInt(tz)); } diff --git a/std/os/time.zig b/std/os/time.zig index e6b614d433..d8a432f1a3 100644 --- a/std/os/time.zig +++ b/std/os/time.zig @@ -52,18 +52,18 @@ pub fn posixSleep(seconds: u63, nanoseconds: u63) void { /// Get the posix timestamp, UTC, in seconds pub fn timestamp() u64 { - return @divFloor(miliTimestamp(), ms_per_s); + return @divFloor(milliTimestamp(), ms_per_s); } /// Get the posix timestamp, UTC, in nanoseconds -pub const miliTimestamp = switch(builtin.os) { - Os.windows => miliTimestampWindows, - Os.linux => miliTimestampPosix, - Os.macosx, Os.ios => miliTimestampDarwin, +pub const milliTimestamp = switch(builtin.os) { + Os.windows => milliTimestampWindows, + Os.linux => milliTimestampPosix, + Os.macosx, Os.ios => milliTimestampDarwin, else => @compileError("Unsupported OS"), }; -fn miliTimestampWindows() u64 { +fn milliTimestampWindows() u64 { //FileTime has a granularity of 100 nanoseconds // and uses the NTFS/Windows epoch var ft: i64 = undefined; @@ -73,7 +73,7 @@ fn miliTimestampWindows() u64 { return u64(@divFloor(ft, hns_per_ms) + epoch_adj); } -fn miliTimestampDarwin() u64 { +fn milliTimestampDarwin() u64 { //Sources suggest MacOS 10.12 has support for // posix clock_gettime. var tv: darwin.timeval = undefined; @@ -84,7 +84,7 @@ fn miliTimestampDarwin() u64 { return u64(sec_ms) + u64(usec_ms); } -fn miliTimestampPosix() u64 { +fn milliTimestampPosix() u64 { //From what I can tell there's no reason clock_gettime // should ever fail for us with CLOCK_REALTIME var ts: posix.timespec = undefined; @@ -238,9 +238,9 @@ test "os.time.timestamp" { const ns_per_ms = (ns_per_s / ms_per_s); const margin = 50; - const time_0 = miliTimestamp(); + const time_0 = milliTimestamp(); sleep(0, ns_per_ms); - const time_1 = miliTimestamp(); + const time_1 = milliTimestamp(); const interval = time_1 - time_0; debug.assert(interval > 0 and interval < margin); } |
