Skip to content

crysalead/code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code - Runs callables with a timeout.

Build Status Code Coverage

API

Runs a callable until a timeout is reached:

declare(ticks = 1);

Code::run(function(){
    sleep(100);
}, 10);

Runs a callable in loop until a timeout is reached and the return value is false:

// declare(ticks = 1); is optionnal when the callable is not blocking on spinning mode

Code::spin(function(){
    sleep(1);
    return false;
}, 10);

About

Runs callables with a timeout

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages