github.com/muyo/sno@v1.2.1/internal/time_windows_amd64.go (about)

     1  package internal
     2  
     3  //go:noescape
     4  func ostime() uint64
     5  
     6  // Snotime returns the current wall clock time reported by the OS as adjusted to our internal epoch.
     7  func Snotime() uint64 {
     8  	// Note: Division is left here instead of being impl in asm since the compiler optimizes this
     9  	// into mul+shift, which is easier to read when left in as simple division.
    10  	// This doesn't affect performance. The asm won't get inlined anyway while this function
    11  	// will.
    12  	//
    13  	// 4e4 instead of TimeUnit (4e6) because the time we get from the OS is in units of 100ns.
    14  	return ostime() / 4e4
    15  }