Source file src/runtime/time_nofake.go

Documentation: runtime

     1  // Copyright 2019 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // +build !faketime
     6  
     7  package runtime
     8  
     9  import "unsafe"
    10  
    11  // faketime is the simulated time in nanoseconds since 1970 for the
    12  // playground.
    13  //
    14  // Zero means not to use faketime.
    15  var faketime int64
    16  
    17  //go:nosplit
    18  func nanotime() int64 {
    19  	return nanotime1()
    20  }
    21  
    22  func walltime() (sec int64, nsec int32) {
    23  	return walltime1()
    24  }
    25  
    26  // write must be nosplit on Windows (see write1)
    27  //
    28  //go:nosplit
    29  func write(fd uintptr, p unsafe.Pointer, n int32) int32 {
    30  	return write1(fd, p, n)
    31  }
    32  

View as plain text