It is currently November 29th, 2023, 5:59 am
Simple countdown timer
-
- Posts: 1140
- Joined: February 17th, 2011, 7:45 pm
- Location: a Galaxy S7 far far away
Re: Simple countdown timer
Can I just ask again as you probably missed it, why such a fast update rate?
- MuLab -
-
- Rainmeter Sage
- Posts: 6366
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Simple countdown timer
Never bothered (and will never bother) with such things. My time skin is updating at 1000 ms and doesn't skip seconds, unless, of course, the CPU is very busy. But then, when the CPU is really very busy, these kind of minor "issues" will happen even if the update rate is lower, so you end up having the same "problem". It's not like I'm watching the clock every second anyway, so if it happens once a day or so when I'm not paying attention to it, it's not such a big deal...

-
- Moderator
- Posts: 1244
- Joined: February 16th, 2012, 3:32 am
- Location: Berlin, Germany
Re: Simple countdown timer
In theory when the Update equals 1000 the skin shouldn't skip seconds because the skin updates with the same speed as the seconds.Yincognito wrote: ↑July 29th, 2021, 12:35 pm Never bothered (and will never bother) with such things. My time skin is updating at 1000 ms and doesn't skip seconds, unless, of course, the CPU is very busy. But then, when the CPU is really very busy, these kind of minor "issues" will happen even if the update rate is lower, so you end up having the same "problem". It's not like I'm watching the clock every second anyway, so if it happens once a day or so when I'm not paying attention to it, it's not such a big deal...![]()
-
- Developer
- Posts: 22593
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Simple countdown timer
In theory. What Update=1000 means is that Rainmeter will "try" to update once every 1000 milliseconds. There is no absolute guarantee that it will always be able to do so, it depends a bit on what else your system and Rainmeter are busy doing at any given time.Active Colors wrote: ↑July 29th, 2021, 1:22 pm In theory when the Update equals 1000 the skin shouldn't skip seconds because the skin updates with the same speed as the seconds.
Do NOT equate Update to seconds on a clock. It won't always work.
A skin that has Update=1000 and counts from 0 to 100 in a measure is in no way certain to be at 100 in 100 seconds on the clock. In a practical sense this isn't going to matter, unless you try to use Update to control some very exact amount of "elapsed time". Update is "more or less". For exact measurements of elapsed time, I would always use a Time measure, where if it DOES "skip" an Update, it will "catch up". I'd probably set Update=900 or Update=950 or something, to reduce any "skipped" or "jerky" seconds in the visible display of the Time measure.
It's perfectly fine to consider Update=1000 to mean "once a second". Just keep in mind it really means "pretty much once a second".
-
- Moderator
- Posts: 1244
- Joined: February 16th, 2012, 3:32 am
- Location: Berlin, Germany
Re: Simple countdown timer
Thanks for the correction! I am myself have been wondering why there is such a case of jerky seconds. After you explained I see now.jsmorley wrote: ↑July 29th, 2021, 1:24 pm In theory. What Update=1000 means is that Rainmeter will "try" to update once every 1000 milliseconds. There is no absolute guarantee that it will always be able to do so, it depends a bit on what else your system and Rainmeter are busy doing at any given time.
Do NOT equate Update to seconds on a clock. It won't always work.
A skin that has Update=1000 and counts from 0 to 100 in a measure is in no way certain to be at 100 in 100 seconds on the clock. In a practical sense this isn't going to matter, unless you try to use Update to control some very exact amount of "elapsed time". Update is "more or less". For exact measurements of elapsed time, I would always use a Time measure, where if it DOES "skip" an Update, it will "catch up". I'd probably set Update=900 or Update=950 or something, to reduce any "skipped" or "jerky" seconds in the visible display of the Time measure.
It's perfectly fine to consider Update=1000 to mean "once a second". Just keep in mind it really means "pretty much once a second".
-
- Developer
- Posts: 22593
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Simple countdown timer
Yes. Here is an example of where I'm using Time measures to track seconds, while setting Update very low in order to eliminate any "skipping / jerky" behavior. There is a lot going on once a second on the "clock", and I don't want Rainmeter to fall behind at any point:
Code: Select all
[Rainmeter]
Update=50
DynamicWindowSize=1
AccurateText=1
OnRefreshAction=[!SetVariable CurrentHours "[MeasureHours]"][!SetVariable CurrentMinutes "[MeasureMinutes]"][!SetVariable CurrentSeconds "[MeasureSeconds]"][!UpdateMeter *][!Redraw]
[Variables]
LinesColor=0,0,0,255
NumberColor=255,255,255,255
BackColor=19,43,77,255
CurrentHoursY=2
NewHoursY=-40
CurrentMinutesY=2
NewMinutesY=-40
CurrentSecondsY=2
NewSecondsY=-40
U=[!UpdateMeasureGroup Sliders][!UpdateMeterGroup Numbers][!Redraw]
; Measures
[MeasureHours]
Measure=Time
Format=%I
OnChangeAction=[!CommandMeasure HoursSlide "Execute 1"]
[MeasureMinutes]
Measure=Time
Format=%M
OnChangeAction=[!CommandMeasure MinutesSlide "Execute 1"]
[MeasureSeconds]
Measure=Time
Format=%S
OnChangeAction=[!CommandMeasure SecondsSlide "Execute 1"]
[HoursSlide]
Measure=Plugin
Plugin=ActionTimer
Group=Sliders
IgnoreWarnings=1
ActionList1=SetThem | Wait 1 | Repeat SlideThem, 20, 21 | Wait 1| SwapThem
SetThem=[!SetVariable CurrentHoursY "2"][!SetVariable NewHoursY "-40"]#U#
SlideThem=[!SetVariable CurrentHoursY "(Clamp(#CurrentHoursY#+2,2,45))"][!SetVariable NewHoursY "(Clamp(#NewHoursY#+2,-40,2))"]#U#
SwapThem=[!SetVariable CurrentHoursY "2"][!SetVariable NewHoursY "-40][!SetVariable CurrentHours "[MeasureHours]"]#U#
UpdateDivider=-1
DynamicVariables=1
[MinutesSlide]
Measure=Plugin
Plugin=ActionTimer
Group=Sliders
IgnoreWarnings=1
ActionList1=SetThem | Wait 1 | Repeat SlideThem, 20, 21 | Wait 1| SwapThem
SetThem=[!SetVariable CurrentMinutesY "2"][!SetVariable NewMinutesY "-40"]#U#
SlideThem=[!SetVariable CurrentMinutesY "(Clamp(#CurrentMinutesY#+2,2,45))"][!SetVariable NewMinutesY "(Clamp(#NewMinutesY#+2,-40,2))"]#U#
SwapThem=[!SetVariable CurrentMinutesY "2"][!SetVariable NewMinutesY "-40][!SetVariable CurrentMinutes "[MeasureMinutes]"]#U#
UpdateDivider=-1
DynamicVariables=1
[SecondsSlide]
Measure=Plugin
Plugin=ActionTimer
Group=Sliders
IgnoreWarnings=1
ActionList1=SetThem | Wait 1 | Repeat SlideThem, 20, 21 | Wait 1| SwapThem
SetThem=[!SetVariable CurrentSecondsY "2"][!SetVariable NewSecondsY "-40"]#U#
SlideThem=[!SetVariable CurrentSecondsY "(Clamp(#CurrentSecondsY#+2,2,45))"][!SetVariable NewSecondsY "(Clamp(#NewSecondsY#+2,-40,2))"]#U#
SwapThem=[!SetVariable CurrentSecondsY "2"][!SetVariable NewSecondsY "-40][!SetVariable CurrentSeconds "[MeasureSeconds]"]#U#
UpdateDivider=-1
DynamicVariables=1
; Meters
[MeterContainer]
Meter=Shape
Shape=Rectangle 1,1,126,43 | StrokeWidth 2
UpdateDivider=-1
[MeterNewHours]
Meter=String
Group=Numbers
MeasureName=MeasureHours
W=30
H=32
X=22
Y=#NewHoursY#
StringAlign=Center
FontFace=Fira Sans
FontSize=20
FontColor=#NumberColor#
SolidColor=#BackColor#
Padding=5,5,5,5
AntiAlias=1
Container=MeterContainer
UpdateDivider=-1
DynamicVariables=1
[MeterCurrentHours]
Meter=String
Group=Numbers
W=30
H=32
X=22
Y=#CurrentHoursY#
StringAlign=Center
FontFace=Fira Sans
FontSize=20
FontColor=#NumberColor#
SolidColor=#BackColor#
Padding=5,5,5,5
AntiAlias=1
Text=#CurrentHours#
Container=MeterContainer
UpdateDivider=-1
DynamicVariables=1
[MeterNewMinutes]
Meter=String
Group=Numbers
MeasureName=MeasureMinutes
W=30
X=64
Y=#NewMinutesY#
H=32
StringAlign=Center
FontFace=Fira Sans
FontSize=20
FontColor=#NumberColor#
SolidColor=#BackColor#
Padding=5,5,5,5
AntiAlias=1
Container=MeterContainer
UpdateDivider=-1
DynamicVariables=1
[MeterCurrentMinutes]
Meter=String
Group=Numbers
MeasureName=MeasureMinutes
W=30
X=64
Y=#CurrentMinutesY#
H=32
StringAlign=Center
FontFace=Fira Sans
FontSize=20
FontColor=#NumberColor#
SolidColor=#BackColor#
Padding=5,5,5,5
AntiAlias=1
Text=#CurrentMinutes#
Container=MeterContainer
UpdateDivider=-1
DynamicVariables=1
[MeterNewSeconds]
Meter=String
Group=Numbers
MeasureName=MeasureSeconds
W=30
X=106
Y=#NewSecondsY#
H=32
StringAlign=Center
FontFace=Fira Sans
FontSize=20
FontColor=#NumberColor#
SolidColor=#BackColor#
Padding=5,5,5,5
AntiAlias=1
Container=MeterContainer
UpdateDivider=-1
DynamicVariables=1
[MeterCurrentSeconds]
Meter=String
Group=Numbers
W=30
X=106
Y=#CurrentSecondsY#
H=32
StringAlign=Center
FontFace=Fira Sans
FontSize=20
FontColor=#NumberColor#
SolidColor=#BackColor#
Padding=5,5,5,5
AntiAlias=1
Text=#CurrentSeconds#
Container=MeterContainer
UpdateDivider=-1
DynamicVariables=1
[MeterOutline]
Meter=Shape
Shape=Rectangle 1,1,126,43 | StrokeWidth 2 | Stroke Color #LinesColor# | Fill Color 0,0,0,0
Shape2=Line 43,2,43,43 | StrokeWidth 2 | Stroke Color #LinesColor#
Shape3=Line 85,2,85,43 | StrokeWidth 2 | Stroke Color #LinesColor#
UpdateDivider=-1
You do not have the required permissions to view the files attached to this post.
-
- Posts: 1140
- Joined: February 17th, 2011, 7:45 pm
- Location: a Galaxy S7 far far away
Re: Simple countdown timer
Thanks for the comments. Well, I tried changing the update to 500 and it caused a delay when clicking the + or - on setting the timer. I then tried 100 and it's ok, so I may settle for that, or try a higher value later on.
Wrt the RoundBar, It does work, but not correctly. If I leave the timer set at 10mins, it works fine.
But if I reduce the time by clicking the - button the RoundBar reduces 10% for each minute, due to the default being 10mins.
If I increase the timer by clicking the + button, so it is more than the default of 10mins, the RoundBar doesn't start to decrease until it reaches that default of 10mins. For example, If I set the timer with the + button to a value of 10m10s, the RoundBar stays full until the timer reaches 10m, which it then starts to react to the timer and then decreases.
Hope that all makes sense?
I am happy with the RoundBar decreasing instead of increasing, so no need to worry about changing that, thank you for the offer though.
Wrt the RoundBar, It does work, but not correctly. If I leave the timer set at 10mins, it works fine.
But if I reduce the time by clicking the - button the RoundBar reduces 10% for each minute, due to the default being 10mins.
If I increase the timer by clicking the + button, so it is more than the default of 10mins, the RoundBar doesn't start to decrease until it reaches that default of 10mins. For example, If I set the timer with the + button to a value of 10m10s, the RoundBar stays full until the timer reaches 10m, which it then starts to react to the timer and then decreases.
Hope that all makes sense?
I am happy with the RoundBar decreasing instead of increasing, so no need to worry about changing that, thank you for the offer though.

- MuLab -
-
- Rainmeter Sage
- Posts: 6366
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Simple countdown timer
As always, jsmorley is correct: there are times when you really want those seconds to be accurate (e.g. timers, AT driven skins, etc), and Rainmeter can't follow precisely the actual clock. For those cases, a lower update rate pays off and yields the expected result. I might have been lucky or something up until now, as I never needed to do it, since for some reason my time skin doesn't seem to miss a beat, so to speak. Either that, or it's doing it when the owner is not looking... 

-
- Rainmeter Sage
- Posts: 15813
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Simple countdown timer
Not sure why did I set it to such a low value (note that as said, the skin is almost 9 years old).
-
- Posts: 1140
- Joined: February 17th, 2011, 7:45 pm
- Location: a Galaxy S7 far far away