go.talks: fix typo and adding slide to Inside the playground
LGTM=crawshaw
R=adg, crawshaw
CC=golang-codereviews
https://golang.org/cl/117150045
diff --git a/2014/playground.slide b/2014/playground.slide
index aa976a8..610e0ad 100644
--- a/2014/playground.slide
+++ b/2014/playground.slide
@@ -261,6 +261,12 @@
5. The corresponding goroutines are woken up.
+* Sleeping fast
+
+Faking time allows precise sleep durations.
+
+.play playground/sleepfast.go
+
* So there's no actual sleep?
The playground's `write` syscall inserts a timestamp before each write.
@@ -303,7 +309,7 @@
More about the Go tour:
-- Inside the Go: playground [[http://blog.golang.org/playground]]
+- Inside the Go playground: [[http://blog.golang.org/playground]]
- The Go tour: [[http://tour.golang.org]]
diff --git a/2014/playground/sleepfast.go b/2014/playground/sleepfast.go
new file mode 100644
index 0000000..b53ddb1
--- /dev/null
+++ b/2014/playground/sleepfast.go
@@ -0,0 +1,16 @@
+package main
+
+import (
+ "fmt"
+ "time"
+)
+
+func main() {
+ start := time.Now()
+ fmt.Println(start)
+
+ for i := 0; i < 10; i++ {
+ time.Sleep(time.Nanosecond)
+ fmt.Println(time.Since(start))
+ }
+}