Is there any way to use get_time(T) [which is built-in function] as an argument when I assert new facts to DB?
(I just want to compare between facts assertion time).
:- dynamic start/2. start_interval(A) :- start(A, _), !, false. start_interval(A) :- assert(start(A, get_time(T))).
Warning: c:/users/*****/desktop/prolog/4.pl:6: Warning: Singleton variables: [T] Welcome to SWI-Prolog (threaded, 64 bits, version 8.2.1) SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software. Please run ?- license. For legal details. For online help and background, visit https://www.swi-prolog.org For built-in help, use ?- help(Topic). or ?- apropos(Word). ?- start_interval(1). true. ?- start_interval(2). true. ?- listing(start). :- dynamic start/2. start(1, get_time(_)). start(2, get_time(_)). true. ?- get_time(T). T = 1598718310.038124.
Instead of “start(#, get_time(_))”, I would like to get to timestamp, which was made when I called start_interval(Num) at first.
(You can see also the output of get_time(T) when I call it)
Is it possible?
Maybe there is another way to compare between facts assertion time?