diff --git a/pl/signals.yap b/pl/signals.yap index 3e529e969..606273eb3 100644 --- a/pl/signals.yap +++ b/pl/signals.yap @@ -249,6 +249,12 @@ alarm(Interval, Goal, Left) :- integer(Interval), !, on_signal(sig_alarm, _, Goal), '$alarm'(Interval, 0, Left, _). +alarm(Number, Goal, Left) :- + float(Number), !, + Secs is integer(Number), + USecs is integer((Number-Secs)*1000000) mod 1000000, + on_signal(sig_alarm, _, Goal), + '$alarm'(Interval, 0, Left, _). alarm(Interval.USecs, Goal, Left.LUSecs) :- on_signal(sig_alarm, _, Goal), '$alarm'(Interval, USecs, Left, LUSecs).