object TimerAnonymous { def oncePerSecond ( callback: () => Unit ) { while ( true ) { callback(); Thread sleep 1000 } } def main ( args: Array[String] ) { oncePerSecond ( () => println ( "time flies like an arrow..." ) ) } }
by: 发表于:2017-09-20 10:13:54 顶(0) | 踩(0) 回复
??
by: 发表于:2017-09-20 10:13:54 顶(0) | 踩(0) 回复
??
回复评论