Ruby里的休眠或者等待?

Ruby里的休眠或者等待?

在VB里我们可以用Sleep(1000)来使线程暂停一秒运行,在C#里我们用System.Threading.Thread.Sleep(1000)来达到同样的目的,那么在php?name=Ruby" onclick="tagshow(event)" class="t_tag">Ruby里呢?
也是sleep,
看ri
----------------------------------------------------------- Kernel#sleep
  sleep([duration])  => fixnum
------------------------------------------------------------------------
Suspends the current thread for _duration_ seconds (which may be
any number, including a +Float+ with fractional seconds). Returns
the actual number of seconds slept (rounded), which may be less
than that asked for if another thread calls +Thread#run+. Zero
arguments causes +sleep+ to sleep forever.

Time.new  #=> Wed Apr 09 08:56:32 CDT 2003
sleep 1.2 #=> 1
Time.new  #=> Wed Apr 09 08:56:33 CDT 2003
sleep 1.9 #=> 2
Time.new  #=> Wed Apr 09 08:56:35 CDT 2003
thanks. 我怎么忘记了RI这么有用的东西了呢。呵呵。
xavier,你真的16岁吗?不像!
英雄出少年啊。呵呵。
引用:
原帖由 drive2me 于 2007-7-25 19:35 发表
xavier,你真的16岁吗?不像!
看来比较牛```
果然英雄少年
要我看得话,至少大学毕业。我16岁时正爱玩呢,英文也没那么好。
要不,你是少年班的,那就另当别论了。呵呵 ...