Link | every |
Author | Ke Carlton |
Category | Action |
Version | 9.x |
License | Public Domain |
Posted | 25 Jul 2013 |
Updated | 25 Jul 2013 |
More by this author... |
Restricts code from executing more frequently than the specified number of seconds. Returns the number of seconds to wait until blocks should be executed.
define my_thread => thread { public active_tick => every(60) => { // do stuff } }
Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.
define every(seconds::integer) => { local( gb = givenblock, v = '_poll_'+#gb->self->type + #gb->methodname, last = var(#v), since = #last ? #last->secondsBetween(date) | #seconds ) if(#since >= #seconds) => { handle => { var(#v) = date } return #gb() || #seconds else return (#seconds - #since) } }
No comments
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft