Platforms to show: All Mac Windows Linux Cross-Platform
Back to NSTimerMBS class.
NSTimerMBS.Constructor(fireDate as date, timeInterval as Double, repeats as boolean)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacCocoa Plugin | 10.0 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
fireDate: The time at which the timer should first fire.
timeInterval: For a repeating timer, this parameter contains the number of seconds between firings of the timer. If seconds is less than or equal to 0.0, this method chooses the nonnegative value of 0.1 milliseconds instead.
repeats: If true, the timer will repeatedly reschedule itself until invalidated. If false, the timer will be invalidated after it fires.
The time is initialized such that, when added to a run loop, it will fire at date and then, if repeats is true, every seconds after that.
See also:
- Constructor(fireDate as date, timeInterval as Double, repeats as boolean, runloop as NSRunLoopMBS, runloopMode as string)
- Constructor(fireDate as dateTime, timeInterval as double, repeats as boolean)
- Constructor(fireDate as dateTime, timeInterval as double, repeats as boolean, runloop as NSRunLoopMBS, runloopMode as string)
- Constructor(timeInterval as Double, repeats as boolean)
NSTimerMBS.Constructor(fireDate as date, timeInterval as Double, repeats as boolean, runloop as NSRunLoopMBS, runloopMode as string)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacCocoa Plugin | 13.5 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
fireDate: The time at which the timer should first fire.
timeInterval: For a repeating timer, this parameter contains the number of seconds between firings of the timer. If seconds is less than or equal to 0.0, this method chooses the nonnegative value of 0.1 milliseconds instead.
repeats: If true, the timer will repeatedly reschedule itself until invalidated. If false, the timer will be invalidated after it fires.
The time is initialized such that, when added to a run loop, it will fire at date and then, if repeats is true, every seconds after that.
Schedules the timer to run on the given runloop in the given mode.
See also:
- Constructor(fireDate as date, timeInterval as Double, repeats as boolean)
- Constructor(fireDate as dateTime, timeInterval as double, repeats as boolean)
- Constructor(fireDate as dateTime, timeInterval as double, repeats as boolean, runloop as NSRunLoopMBS, runloopMode as string)
- Constructor(timeInterval as Double, repeats as boolean)
NSTimerMBS.Constructor(fireDate as dateTime, timeInterval as double, repeats as boolean)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacCocoa Plugin | 20.5 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
timeInterval: The number of seconds between firings of the timer. If seconds is less than or equal to 0.0, this method chooses the nonnegative value of 0.1 milliseconds instead.
repeats: If true, the timer will repeatedly reschedule itself until invalidated. If false, the timer will be invalidated after it fires.
After seconds seconds have elapsed, the timer fires, calling the Action event.
See also:
- Constructor(fireDate as date, timeInterval as Double, repeats as boolean)
- Constructor(fireDate as date, timeInterval as Double, repeats as boolean, runloop as NSRunLoopMBS, runloopMode as string)
- Constructor(fireDate as dateTime, timeInterval as double, repeats as boolean, runloop as NSRunLoopMBS, runloopMode as string)
- Constructor(timeInterval as Double, repeats as boolean)
NSTimerMBS.Constructor(fireDate as dateTime, timeInterval as double, repeats as boolean, runloop as NSRunLoopMBS, runloopMode as string)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacCocoa Plugin | 20.5 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
fireDate: The time at which the timer should first fire.
timeInterval: For a repeating timer, this parameter contains the number of seconds between firings of the timer. If seconds is less than or equal to 0.0, this method chooses the nonnegative value of 0.1 milliseconds instead.
repeats: If true, the timer will repeatedly reschedule itself until invalidated. If false, the timer will be invalidated after it fires.
The time is initialized such that, when added to a run loop, it will fire at date and then, if repeats is true, every seconds after that.
Schedules the timer to run on the given runloop in the given mode.
See also:
- Constructor(fireDate as date, timeInterval as Double, repeats as boolean)
- Constructor(fireDate as date, timeInterval as Double, repeats as boolean, runloop as NSRunLoopMBS, runloopMode as string)
- Constructor(fireDate as dateTime, timeInterval as double, repeats as boolean)
- Constructor(timeInterval as Double, repeats as boolean)
NSTimerMBS.Constructor(timeInterval as Double, repeats as boolean)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacCocoa Plugin | 10.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
timeInterval: The number of seconds between firings of the timer. If seconds is less than or equal to 0.0, this method chooses the nonnegative value of 0.1 milliseconds instead.
repeats: If true, the timer will repeatedly reschedule itself until invalidated. If false, the timer will be invalidated after it fires.
After seconds seconds have elapsed, the timer fires, calling the Action event.
See also:
- Constructor(fireDate as date, timeInterval as Double, repeats as boolean)
- Constructor(fireDate as date, timeInterval as Double, repeats as boolean, runloop as NSRunLoopMBS, runloopMode as string)
- Constructor(fireDate as dateTime, timeInterval as double, repeats as boolean)
- Constructor(fireDate as dateTime, timeInterval as double, repeats as boolean, runloop as NSRunLoopMBS, runloopMode as string)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacCocoa Plugin | 10.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
You can use this method to fire a repeating timer without interrupting its regular firing schedule. If the timer is non-repeating, it is automatically invalidated after firing, even if its scheduled fire date has not arrived.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacCocoa Plugin | 10.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
The destructor calls invalide automatically for you.
This method is the only way to remove a timer from an NSRunLoop object. The NSRunLoop object removes and releases the timer, either just before the invalidate method returns or at some later point.
You must send this message from the thread on which the timer was installed. If you send this message from another thread, the input source associated with the timer may not be removed from its run loop, which could prevent the thread from exiting properly.
The items on this page are in the following plugins: MBS MacCocoa Plugin.