Added the sleep predicate

This commit is contained in:
notoria
2020-04-19 21:35:49 +02:00
parent 2c92be5e3d
commit 5a063c541d
3 changed files with 41 additions and 18 deletions

View File

@@ -9,11 +9,15 @@
'$cpu_new' can be replaced by statistics/2 once that is implemented.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
:- module(time, [time/1]).
:- module(time, [sleep/1, time/1]).
:- use_module(library(format)).
:- use_module(library(iso_ext)).
sleep(T) :-
builtins:must_be_number(T, sleep),
'$sleep'(T).
time(Goal) :-
'$cpu_now'(T0),
Goal,