# Two overlapping timers

**URL:** <https://techcommunity.softwareag.com/t/two-overlapping-timers/75340>\
**Category:** Forum\
**Tags:** Former-Crossvision-Products, Application-Composer\
**Created:** [September 7, 2007, 4:50pm UTC](https://techcommunity.softwareag.com/t/two-overlapping-timers/75340 "2007-09-07T16:50:34Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![consros](https://avatars.discourse-cdn.com/v4/letter/c/7c8e57/32.png) [@consros](https://techcommunity.softwareag.com/u/consros)\
**Post date:** [September 7, 2007, 4:50pm UTC](https://techcommunity.softwareag.com/t/two-overlapping-timers/75340/1 "2007-09-07T16:50:34Z")

</div>

Hi,

it seems we’ve found a bug. We have two timers on same page and each has a dynamically assigned interval. If the intervals are same - in our example it’s 30 seconds - then only one of timers is activated every 30 seconds and another one works only every minute. If we change interval values to 30 and 31 seconds then both timers work properly. Could you please explain this phenomena?

Thank yon in advance,  
Regards,  
Roman

---

<div class="post-metadata">

**Author:** ![consros](https://avatars.discourse-cdn.com/v4/letter/c/7c8e57/32.png) [@consros](https://techcommunity.softwareag.com/u/consros)\
**Post date:** [September 7, 2007, 6:22pm UTC](https://techcommunity.softwareag.com/t/two-overlapping-timers/75340/2 "2007-09-07T18:22:21Z")

</div>

In order to check this outside of our specific environment, I’ve prepared a standalone test with two timers and two rowareas (foldable property). If I set one timer on 2 seconds and another on 4 then the second timer is never updated at all! It looks like if the timer activates during handling of another timer then first event is completely ignored!  
The example’s code is below  
[TwoTimersTest.zip](https://techcommunity.softwareag.com/uploads/short-url/lSBYQM2PP0ILYZam1W6Qa8BqdWD.zip) (13 KB)

---

<div class="post-metadata">

**Author:** ![consros](https://avatars.discourse-cdn.com/v4/letter/c/7c8e57/32.png) [@consros](https://techcommunity.softwareag.com/u/consros)\
**Post date:** [September 14, 2007, 12:16pm UTC](https://techcommunity.softwareag.com/t/two-overlapping-timers/75340/3 "2007-09-14T12:16:52Z")

</div>

Hello? Is someone there?

---

<div class="post-metadata">

**Author:** ![Martin\_Grumann](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@Martin\_Grumann](https://techcommunity.softwareag.com/u/Martin_Grumann)\
**Post date:** [September 18, 2007, 6:39pm UTC](https://techcommunity.softwareag.com/t/two-overlapping-timers/75340/4 "2007-09-18T18:39:57Z")

</div>

Hi

I assume you are using two timers to call different methods/to do different checks on server side. Have you ever thought to use one timer and to do both checks within one roundtrip? Ie one timer that calls server every 30 seconds and does both checks. You spare the roundtrips of the timer that expires every minute - and in addition page updates are closer to status changes on server side.

Martin

---

<div class="post-metadata">

**Author:** ![consros](https://avatars.discourse-cdn.com/v4/letter/c/7c8e57/32.png) [@consros](https://techcommunity.softwareag.com/u/consros)\
**Post date:** [September 18, 2007, 6:46pm UTC](https://techcommunity.softwareag.com/t/two-overlapping-timers/75340/5 "2007-09-18T18:46:18Z")

</div>

Hi,

itervals of timers are different and set by customer. Defaults are 30 seconds and 12 hours. Of course it’s not a big deal to calculate the difference within one handling function and update timer interval accordingly.  
But why should we? Current solution is easier and more readable. Either forbid two timers or make them working.

Regards,  
Roman

---

<div class="post-metadata">

**Author:** ![Martin\_Grumann](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@Martin\_Grumann](https://techcommunity.softwareag.com/u/Martin_Grumann)\
**Post date:** [September 18, 2007, 7:04pm UTC](https://techcommunity.softwareag.com/t/two-overlapping-timers/75340/6 "2007-09-18T19:04:31Z")

</div>

…yes - timers are considered to be page singletons (like PAGEBODY/TITLEBAR/HEADER/STATUSBAR)…

Regrads!

---

<div class="post-metadata">

**Author:** ![consros](https://avatars.discourse-cdn.com/v4/letter/c/7c8e57/32.png) [@consros](https://techcommunity.softwareag.com/u/consros)\
**Post date:** [September 18, 2007, 7:08pm UTC](https://techcommunity.softwareag.com/t/two-overlapping-timers/75340/7 "2007-09-18T19:08:44Z")

</div>

> [@Martin Grumann](#):
>
> …yes - timers are considered to be page singletons (like PAGEBODY/TITLEBAR/HEADER/STATUSBAR)…
> 
> Regrads!

Well, it’s also a way. But such restriction I would already call a “disadvantage”.

Regards,  
Roman

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 2:48pm UTC](https://techcommunity.softwareag.com/t/two-overlapping-timers/75340/8 "2021-04-02T14:48:43Z")

</div>


