Railgun

if it ain't broke, we'll break it

User Tools

Site Tools


senses:packages:kmj-intervals

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

senses:packages:kmj-intervals [2025/07/28 01:38] – created flashsenses:packages:kmj-intervals [2025/07/28 03:26] (current) – args & rets on same level as syntax flash
Line 18: Line 18:
   create(action: function, number: delay, number: times = -1): (interval: number)   create(action: function, number: delay, number: times = -1): (interval: number)
  
-=== Arguments ===+==== Arguments ====
  
   - The first argument should contain the function that is to be run at an interval or be deferred.   - The first argument should contain the function that is to be run at an interval or be deferred.
Line 24: Line 24:
   - The third argument contains the amount of times the interval should be run, if **''-1'' or any other value less than ''0''**, the interval will run indefinitely, if **''0''**, the interval creation will essentially be a no-op, **any value greater than ''0''** will have the value decrease with ''1'' every time it is run, until the value reaches ''0'' at which point it is destroyed.   - The third argument contains the amount of times the interval should be run, if **''-1'' or any other value less than ''0''**, the interval will run indefinitely, if **''0''**, the interval creation will essentially be a no-op, **any value greater than ''0''** will have the value decrease with ''1'' every time it is run, until the value reaches ''0'' at which point it is destroyed.
  
-=== Return values ===+==== Returns ====
  
   - The first return value contains a unique identifier representing the interval registration. It can be used to (prematurely) destroy it to prevent it from running further.   - The first return value contains a unique identifier representing the interval registration. It can be used to (prematurely) destroy it to prevent it from running further.
Line 36: Line 36:
   destroy(interval: number): ()   destroy(interval: number): ()
  
-=== Arguments ===+==== Arguments ====
  
   - The first argument should contain the unique identifier of an interval returned at creation.   - The first argument should contain the unique identifier of an interval returned at creation.
  
-=== Return values ===+==== Returns ====
  
 //This function does not return anything.// //This function does not return anything.//
senses/packages/kmj-intervals.txt · Last modified: by flash