这个问题在这里已有答案:
以下是Go核心库的sleep.go
包中time
文件的第一行:
// Sleep pauses the current goroutine for at least the duration d.
// A negative or zero duration causes Sleep to return immediately.
func Sleep(d Duration)
// runtimeNano returns the current value of the runtime clock in nanoseconds.
func runtimeNano() int64
为什么这里没有函数time.Sleep
的声明?它在哪里?
有关compiler directives的详细信息,请参阅go:linkname
。