Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
24 lines (20 sloc) 649 Bytes
// Package gokrazy makes it easier to adapt tools to
package gokrazy
import "time"
// WaitForClock returns once the system clock appears to have been
// set. Assumes that the system boots with a clock value of January 1,
// 1970 UTC (UNIX epoch), as is the case on the Raspberry Pi 3.
func WaitForClock() {
epochPlus1Year := time.Unix(60*60*24*365, 0)
for {
if time.Now().After(epochPlus1Year) {
// Sleeps for 1 real second, regardless of wall-clock time.
// See
time.Sleep(1 * time.Second)
func init() {
You can’t perform that action at this time.