loopdk 92 Posted May 6, 2016 Hallo guys. I am trying to make a small obstacle cource I am trying to have 1 a trigger to start time 2 a trigger to stop time 3 a viseble timer on scrren while the triggers ar activ... google is not my friend :/ Share this post Link to post Share on other sites
R3vo 2654 Posted May 6, 2016 1. Place a start trigger - on activation: time_start = diag_tickTime; time_running = true; 0 = [] spawn { while {time_running} do { _time = (diag_tickTime - time_start) call BIS_fnc_secondsToString; hintSilent format ["Time: %1",_time]; sleep 1; }; }; 2. Place a end trigger - on activation: time_running = false; I hope that helps. 3 Share this post Link to post Share on other sites
R3vo 2654 Posted May 7, 2016 Remove the comments, everything behind // Share this post Link to post Share on other sites
loopdk 92 Posted May 8, 2016 It works..... almost..... the time is way to fast!! Share this post Link to post Share on other sites
tryteyker 28 Posted May 8, 2016 Test sleep 1; instead of sleep 0.1; Share this post Link to post Share on other sites
R3vo 2654 Posted May 8, 2016 I updated my code with a more accurate solution. See above. 1 Share this post Link to post Share on other sites
Jackal98 0 Posted August 15, 2018 On 06/05/2016 at 6:58 PM, R3vo said: 1. Place a start trigger - on activation: time_start = diag_tickTime; time_running = true; 0 = [] spawn { while {time_running} do { _time = (diag_tickTime - time_start) call BIS_fnc_secondsToString; hintSilent format ["Time: %1",_time]; sleep 1; }; }; 2. Place a end trigger - on activation: time_running = false; I hope that helps. Hey, sorry for coming back onto an old thread. But im trying to use this script which is working, however, is there any way I can make a timer that shows milliseconds too? Like a race timer, for example, I want people to see there tenths. Cheers :) Share this post Link to post Share on other sites
R3vo 2654 Posted August 15, 2018 time_start = diag_tickTime; time_running = true; 0 = [] spawn { while {time_running} do { _time = [(diag_tickTime - time_start),"MM:SS.MS"] call BIS_fnc_secondsToString; hintSilent format ["Time: %1",_time]; sleep 0.001; }; }; That should work, although it's not 100% accurate. Share this post Link to post Share on other sites
imager6 40 Posted September 25, 2019 I am making an obstacle course and plan to have 3 courses side by side. I have a stop watch script that works well for only one stop watch at a time. Is there a way to run 3 timers at the same time with start and stop triggers for each stop watch and course. 1. Place a start trigger - on activation: time_start = diag_tickTime; time_running = true; 0 = [] spawn { while {time_running} do { _time = (diag_tickTime - time_start) call BIS_fnc_secondsToString; hintSilent format ["Time: %1",_time]; sleep 1; }; }; 2. Place a end trigger - on activation: time_running = false; Share this post Link to post Share on other sites
gokitty1199 225 Posted September 25, 2019 2 hours ago, imager6 said: I am making an obstacle course and plan to have 3 courses side by side. I have a stop watch script that works well for only one stop watch at a time. Is there a way to run 3 timers at the same time with start and stop triggers for each stop watch and course. 1. Place a start trigger - on activation: time_start = diag_tickTime; time_running = true; 0 = [] spawn { while {time_running} do { _time = (diag_tickTime - time_start) call BIS_fnc_secondsToString; hintSilent format ["Time: %1",_time]; sleep 1; }; }; 2. Place a end trigger - on activation: time_running = false; when i automated my competition shooting mission, i set the starting time and final time as variables on the timer itself. Set an action or trigger that fires a loop(if you need to see the time displayed continually), or set the start time and end time and subtract them to see the total time(more accurate than a loop timer unless you perform checks every 5 seconds or so to set the time to the proper time). what you could do is set the start time on the timer right as the script starts/trigger activates and start your loop. have a local variable be your current time. every 5 seconds, get the current time with "time" and subtract start time from it, then set your current time varaible to equal it. you can run multiple timers at once but keep in mind a hint will get overwritten with each new hint Share this post Link to post Share on other sites