It is currently March 29th, 2024, 1:31 pm

Optimizing [Updated: 22/12/09]

Tips and Tricks from the Rainmeter Community
MattKing
Developer
Posts: 98
Joined: August 6th, 2009, 3:03 pm

Re: Optimizing [Updated: 22/12/09]

Post by MattKing »

Alex2539 wrote:The problem you were experiencing was probably related to the fact that when a Calc measure uses a value from another measure it will always be one update behind. So when you get the value of a Calc measure that's already getting the value of another measure, you will be two full updates behind the original value. If you don't take steps to compensate for this, it can sometimes have undesired effects.
Do you think you could elaborate on this, I think it is a likely problem people will have in the future.
User avatar
Alex2539
Rainmeter Sage
Posts: 642
Joined: July 19th, 2009, 5:59 am
Location: Montreal, QC, Canada

Re: Optimizing [Updated: 22/12/09]

Post by Alex2539 »

it's pretty simple to demonstrate. Run this and check the values in the About screen:

Code: Select all

[Rainmeter]
Update=1000

[Meas1]
Measure=Time
Format=%S

[Calc1]
Measure=Calc
Formula=Meas1

[Calc2]
Measure=Calc
Formula=Calc1

[Calc3]
Measure=Calc
Formula=Calc2
You'll see that Calc3 is one second behind Calc2, which is one second behind Calc1, which is one second behind Meas1. What I normally do is add whatever amount is likely to be missing from the Calc statements. With seconds it's pretty easy since you know you'll always be behind by one, you can just add 1 to keep it up-to-date.
ImageImageImageImage
User avatar
killall-q
Posts: 305
Joined: August 14th, 2009, 8:04 am

Re: Optimizing [Updated: 22/12/09]

Post by killall-q »

This is a great help before I release my clock. I was wondering why you added 1 in your polar clock.
Omardude
Posts: 22
Joined: December 2nd, 2009, 7:05 pm

Re: Optimizing [Updated: 22/12/09]

Post by Omardude »

I'll add this ASAP. (Not home atm)