71件ヒット
[1-71件を表示]
(0.171秒)
クラス
- Monitor (5)
-
MonitorMixin
:: ConditionVariable (11) - Time (55)
検索結果
先頭5件
-
Time
# mon -> Integer (27208.0) -
月を整数で返します。
...月を整数で返します。
//emlist[][ruby]{
t = Time.local(2000,1,2,3,4,5) # => 2000-01-02 03:04:05 +0900
p t.month # => 1
p t.mon # => 1
//}... -
Time
# month -> Integer (15308.0) -
月を整数で返します。
...月を整数で返します。
//emlist[][ruby]{
t = Time.local(2000,1,2,3,4,5) # => 2000-01-02 03:04:05 +0900
p t.month # => 1
p t.mon # => 1
//}... -
Time
# monday? -> bool (15201.0) -
self の表す時刻が月曜日である場合に true を返します。 そうでない場合に false を返します。
...self の表す時刻が月曜日である場合に true を返します。
そうでない場合に false を返します。
//emlist[][ruby]{
t = Time.local(2003, 8, 4) # => 2003-08-04 00:00:00 +0900
p t.monday? # => true
//}... -
Monitor
# wait _ for _ cond(cond , timeout) -> bool (9301.0) -
MonitorMixin::ConditionVariable 用の内部メソッドです。
...MonitorMixin::ConditionVariable 用の内部メソッドです。
@param cond Thread::ConditionVariable を指定します。
@param timeout タイムアウトまでの秒数。指定しなかった場合はタイムアウトしません。
@return タイムアウトしたときは false を返し......ます。それ以外は true を返します。
//emlist[例][ruby]{
require 'monitor'
m = Monitor.new
cv = Thread::ConditionVariable.new
m.enter
m.wait_for_cond(cv, 1)
//}... -
Monitor
# wait _ for _ cond(cond , timeout) -> true (9301.0) -
MonitorMixin::ConditionVariable 用の内部メソッドです。
...MonitorMixin::ConditionVariable 用の内部メソッドです。
@param cond Thread::ConditionVariable を指定します。
@param timeout タイムアウトまでの秒数。指定しなかった場合はタイムアウトしません。
@return Ruby 1.9 の頃からのバグで常に true を......返します。(16608)
//emlist[例][ruby]{
require 'monitor'
m = Monitor.new
cv = Thread::ConditionVariable.new
m.enter
m.wait_for_cond(cv, 1)
//}... -
Time
# strftime(format) -> String (9237.0) -
時刻を format 文字列に従って文字列に変換した結果を返します。
...す。使用できるものは 以下の通りです。
* %A: 曜日の名称(Sunday, Monday ... )
* %a: 曜日の省略名(Sun, Mon ... )
* %B: 月の名称(January, February ... )
* %b: 月の省略名(Jan, Feb ... )
* %C: 世紀 (2009年であれば 20)
* %c: 日付と時刻 (%a %b %......* %n: 改行 (\n)
* %N: 秒の小数点以下。桁の指定がない場合は9桁 (ナノ秒)、%6N: マイクロ秒 (6桁)、%3N: ミリ秒 (3桁)
* %P: 午前または午後(am,pm)
* %p: 午前または午後(AM,PM)
* %Q: 1970-01-01 00:00:00 UTC からの経過ミリ秒 (Time#strftime......は対応していませんが、Date#strftime で使えます)
* %R: 24時間制の時刻。%H:%M と同等。
* %r: 12時間制の時刻。%I:%M:%S %p と同等。
* %S: 秒(00-60) (60はうるう秒)
* %s: 1970-01-01 00:00:00 UTC からの経過秒
* %T: 24時間制の時刻。%H:%M:%S... -
MonitorMixin
:: ConditionVariable # wait(timeout = nil) -> bool (6201.0) -
モニタのロックを開放し、現在のスレッドを停止します。
...ロックを保持している必要があります。
MonitorMixin::ConditionVariable#signal や
MonitorMixin::ConditionVariable#broadcast
で起こされるまでスレッドは停止し続けます。
timeout を与えた場合は最大 timeout 秒まで停止した後にスレッドを
再開......って危険領域(critical section)上で動作している
スレッドはただ一つになり、排他を実現します。
true を返します。timeout が与えられていて待ち時間が timeout を
越えた場合は false を返します。
@param timeout タイムアウトまでの......秒数。指定しなかった場合はタイムアウトしません。
@raise ThreadError ロックを持っていないスレッドがこのメソッドを呼びだした場合に発生します
@see MonitorMixin::ConditionVariable#wait_while, MonitorMixin::ConditionVariable#wait_until... -
Time
# wday -> Integer (3113.0) -
曜日を0(日曜日)から6(土曜日)の整数で返します。
...sun = Time.new(2017, 9, 17, 10, 34, 15, '+09:00') # => 2017-09-17 10:34:15 +0900
p sun.wday # => 0
p mon = Time.new(2017, 9, 18, 10, 34, 15, '+09:00') # => 2017-09-18 10:34:15 +0900
p mon.wday # => 1
p tue = Time.new(......ed = Time.new(2017, 9, 20, 10, 34, 15, '+09:00') # => 2017-09-20 10:34:15 +0900
p wed.wday # => 3
p thu = Time.new(2017, 9, 21, 10, 34, 15, '+09:00') # => 2017-09-21 10:34:15 +0900
p thu.wday # => 4
p fri = Time.new(20......17, 9, 22, 10, 34, 15, '+09:00') # => 2017-09-22 10:34:15 +0900
p fri.wday # => 5
p sat = Time.new(2017, 9, 23, 10, 34, 15, '+09:00') # => 2017-09-23 10:34:15 +0900
p sat.wday # => 6
//}...