artem_niko Posted November 19, 2022 Share Posted November 19, 2022 Good evening! What is the fundamental difference between UniTimer and UniThreadTimer? The fact is that if you put a UniTimer on a form that simply displays the current time or performs some action, and, for example, switch to another tab in the browser, at that moment UniTimer stops working, until you return back to the tab with the project. Why is this happening? What is the difference between these components? Is it possible to make the timer work, regardless of which tab I am on in the browser? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 19, 2022 Share Posted November 19, 2022 Hello, http://forums.unigui.com/index.php?/topic/14085-desktop-login-form-threadtimer-ajax-event-how/&do=findComment&comment=75832 Quote Link to comment Share on other sites More sharing options...
artem_niko Posted November 19, 2022 Author Share Posted November 19, 2022 16 minutes ago, Sherzod said: Hello, http://forums.unigui.com/index.php?/topic/14085-desktop-login-form-threadtimer-ajax-event-how/&do=findComment&comment=75832 It turns out that you can simply replace UniTimer with UniThreadTimer and that's it, then everything will be as it should and work continuously? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 19, 2022 Share Posted November 19, 2022 1 hour ago, artem_niko said: The fact is that if you put a UniTimer on a form that simply displays the current time or performs some action, and, for example, switch to another tab in the browser, at that moment UniTimer stops working, until you return back to the tab with the project. It's not, the timer will work. Quote Link to comment Share on other sites More sharing options...
artem_niko Posted November 19, 2022 Author Share Posted November 19, 2022 7 minutes ago, Sherzod said: Это не так, таймер будет работать. Something, after reading the link, after reading your answers, got confused. I tried the code from the link, but I couldn't get UniThreadTimer to work. Can I have a code example, how to do it correctly? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 19, 2022 Share Posted November 19, 2022 10 minutes ago, Sherzod said: It's not, the timer will work. I mean UniTimer... Quote Link to comment Share on other sites More sharing options...
artem_niko Posted November 19, 2022 Author Share Posted November 19, 2022 4 minutes ago, Sherzod said: Я имею в виду UniTimer... Well, it works, yes. But, if you temporarily switch to another tab, i.e. if the tab with the project loses focus, and then return, the timer will continue working from the moment it was before the tab lost focus. That's what I'm talking about. For example, if 10 seconds have passed, I went to another tab and stayed on it for 10 seconds, and then returned back to the project tab, then the timer will continue to work from the 11th second, and not from the 21st... Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 19, 2022 Share Posted November 19, 2022 18 minutes ago, artem_niko said: But, if you temporarily switch to another tab, i.e. if the tab with the project loses focus, and then return, the timer will continue working from the moment it was before the tab lost focus. That's what I'm talking about. For example, if 10 seconds have passed, I went to another tab and stayed on it for 10 seconds, and then returned back to the project tab, then the timer will continue to work from the 11th second, and not from the 21st... So, and I say again that UniTimer should continue to work, regardless of whether the tab is active or not. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 19, 2022 Share Posted November 19, 2022 You can check it in the online demo for example (Timer->Timer demo): http://prime.fmsoft.net/demo/desktop/mdemo.dll 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.