x += 3
time.Sleep(3 * time.Second)
fmt.Println(x, "time to wait")
It first increases x, then sleeps, then prints the “time to wait message”.
When the program starts (at time 0s) it sleeps (from time 0s to 3s) and prints "3 time to wait".
After that it sleeps again (from time 3s to 6s) and prints 6 time to wait.
The message "12 time to wait" is printed after sleeping from time 9s to 12s. That’s why if falls asleep before the "10 seconds over...." time.