Skip to content

Add sleep built in function

Geofrey Ernest requested to merge gernest:sleep into master

This function is useful for delaying execution. The implementation is based on pg_sleep which accepts a number of seconds to sleep.

select sleep(5);

will sleep 5 seconds before returning.

APOLOGIES to reviewer. I had to make three changes in defferent parts to accomodate this, the changes in ql tool were meant to help demoonstrate the use of this function like on pg_sleep.

ql -i
ql> select now(); select sleep(5) ; select now();
2017-05-11 16:18:35.06018569 +0300 EAT
<nil>
2017-05-11 16:18:40.062569337 +0300 EAT
ql>

Check the differece in seconds between the first result set and the third. There is still a lot to be done on ql tool.

EDIT: Fix typo

Merge request reports