You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
303 B
16 lines
303 B
13 years ago
|
object Timer {
|
||
|
def oncePerSecond(callback: () => Unit) {
|
||
|
while (true) { callback(); Thread sleep 1000 }
|
||
|
}
|
||
|
|
||
|
def timeFlies() {
|
||
|
println("time flies like an arrow...")
|
||
|
}
|
||
|
|
||
|
def main(args: Array[String]) {
|
||
|
oncePerSecond(timeFlies)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// vim: set ts=4 sw=4 et:
|