move code to src/test
* so that it compiles and tests pass * fix some additional snip references in getting started
This commit is contained in:
parent
413df8e0f4
commit
59f53e1a22
289 changed files with 45 additions and 45 deletions
26
akka-docs/src/test/scala/docs/duration/Sample.scala
Normal file
26
akka-docs/src/test/scala/docs/duration/Sample.scala
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
/**
|
||||
* Copyright (C) 2013-2017 Lightbend Inc. <http://www.lightbend.com>
|
||||
*/
|
||||
|
||||
package docs.duration
|
||||
|
||||
import language.postfixOps
|
||||
|
||||
object Scala {
|
||||
//#dsl
|
||||
import scala.concurrent.duration._
|
||||
|
||||
val fivesec = 5.seconds
|
||||
val threemillis = 3.millis
|
||||
val diff = fivesec - threemillis
|
||||
assert(diff < fivesec)
|
||||
val fourmillis = threemillis * 4 / 3 // you cannot write it the other way around
|
||||
val n = threemillis / (1 millisecond)
|
||||
//#dsl
|
||||
|
||||
//#deadline
|
||||
val deadline = 10.seconds.fromNow
|
||||
// do something
|
||||
val rest = deadline.timeLeft
|
||||
//#deadline
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue