Nasal library: Difference between revisions

Jump to navigation Jump to search
1,074 bytes added ,  11 December 2016
m
(Update {{func link}} form)
Line 1,739: Line 1,739:


=== maketimer() ===
=== maketimer() ===
{{Note|
As part of investigating the possibility of running a trimming time period, James noticed that our current Nasal timers don’t actually expose the ‘sim vs realtime’ option from the Event-manager, so he's pushed a change to fix this. It’s via a boolean attribute ‘simulatedTime’, defaults to false for backwards compatibility. The ‘settimer’ approach does support this flag since ‘forever’ but of course settimer should eventually be replaced with timer-objects to reduce GC thrash in Nasal. The attribute can’t be changed while the timer is running, BTW. But you can stop the timer, change the value and start it again. Probably, > 50% of Nasal timers should be using simulated time, so pause and sim-speed-up work automatically<ref>{{cite web
  |url    =  https://sourceforge.net/p/flightgear/mailman/message/35545028/
  |title  =  <nowiki> [Flightgear-devel] Nasal timers using sim-dt </nowiki>
  |author =  <nowiki> James Turner </nowiki>
  |date  =  Dec 11th, 2016
  |added  =  Dec 11th, 2016
  |script_version = 0.40
  }}</ref>
}}
{{Nasal doc
{{Nasal doc
|syntax = maketimer(interval[, self], function);
|syntax = maketimer(interval[, self], function);

Navigation menu