runtime/unix: simplify time functions
There is no need for separate datatypes for 32-bit and 64-bit *nix systems, because the int type already provides this.
Этот коммит содержится в:
родитель
ad73a727a3
коммит
946e2dd405
3 изменённых файлов: 5 добавлений и 15 удалений
|
@ -35,10 +35,12 @@ type timeUnit int64
|
||||||
|
|
||||||
const tickMicros = 1
|
const tickMicros = 1
|
||||||
|
|
||||||
// TODO: Linux/amd64-specific
|
// Note: tv_sec and tv_nsec vary in size by platform. They are 32-bit on 32-bit
|
||||||
|
// systems and 64-bit on 64-bit systems (at least on macOS/Linux), so we can
|
||||||
|
// simply use the 'int' type which does the same.
|
||||||
type timespec struct {
|
type timespec struct {
|
||||||
tv_sec timeT
|
tv_sec int // time_t: follows the platform bitness
|
||||||
tv_nsec timeT
|
tv_nsec int // long: on Linux and macOS, follows the platform bitness
|
||||||
}
|
}
|
||||||
|
|
||||||
const CLOCK_MONOTONIC_RAW = 4
|
const CLOCK_MONOTONIC_RAW = 4
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
// +build !baremetal
|
|
||||||
// +build arm
|
|
||||||
|
|
||||||
package runtime
|
|
||||||
|
|
||||||
type timeT int32
|
|
|
@ -1,6 +0,0 @@
|
||||||
// +build !baremetal
|
|
||||||
// +build arm64 amd64 i386
|
|
||||||
|
|
||||||
package runtime
|
|
||||||
|
|
||||||
type timeT int64
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче