You have multiple problems:
1. You are passing `counter` to the goroutine as a value, making a copy
2. You have to call `wg.Add` *before* the `go` statement, otherwise it is possible that the loop finishes before any of the goroutines get scheduled, causing `wg.Wait` to immediately return
3. The playground likely doesn't actually let you consume 10s of CPU time. Normally, the emulated time of the playground means that sleeping for 10s is not a problem (as it doesn't *actually* sleep), but you are busy-looping, so you are actually taking up CPU time.
It still times out in the playground, though.