It is currently March 28th, 2024, 3:33 pm

UpdateDivider

General topics related to Rainmeter.
Post Reply
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

UpdateDivider

Post by kyriakos876 »

I've been reading the docs and I don't see anywhere saying that the UpdateDivider can not be applied in a meter. So my question is as follows:

Would it make any difference if I added UpdateDivider = -1 in every meter that I don't want to be updated, or is it like this by default and only if DynamicVariables = 1 is added, will the meter update?

-Thanks in advance.
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy
Contact:

Re: UpdateDivider

Post by fonpaolo »

Usually I always add UpdateDivider=-1 to any meter (image or text) that doesn't need any update or at least when it doesn't need to be updated often.

Remember to add OnChangeAction=[!UpdateMeter ...]* to the measure the meter is related.
*(as an example)
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: UpdateDivider

Post by kyriakos876 »

Oh, so I guess it does something then. Cool.
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy
Contact:

Re: UpdateDivider

Post by fonpaolo »

Maybe i'm obsessed, but, at least for me, try to use less resources as possible using my skins is the first thought I have, just after I have build something.

Not only I always use UpdateDivider=-1 as much as I can, but, if a skin doesn't control anything changing often, or at all, as launchers or system informations, I also use Update=-1 in the Rainmeter section, if then I need to update it, I can do it manually using a mouse click with a command.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: UpdateDivider

Post by kyriakos876 »

Yea I'll do the same :D
User avatar
tjhrulz
Developer
Posts: 267
Joined: October 13th, 2016, 1:28 am
Location: Earth
Contact:

Re: UpdateDivider

Post by tjhrulz »

Yeah my 2 cents on how to do updates the best way in Rainmeter. Sorry in advance for the poor formatting.

So if you do not know Rainmeter essentially has three different update timers, all are in milliseconds so 1000 = 1 second.
Update - The global skin update rate, default 1000. Every other update type gets multiplied by this.

UpdateDivider - The update rate of a specific measure/meter, default 1. This is multiplied by the general update rate of the skin to get how often the measure/meter should fetch new data. However as you may have noticed while it may get new data from the measure and display it options that are dynamic do not always take affect unless DynamicVariables=1 (More on this later).

UpdateRate - Specific to just Ping and Webparser measures, it is still multiplied by the general update rate and specifies how often it should connect to the webpage provided. (Edit: jsmorley reminded me that technically it is Update x UpdateDivider x UpdateRate however you should really never need to set UpdateDivider on these measures unless you really need to read new options at a specific interval more often than your UpdateRate)


So how does DynamicVariables, SetOption, Update, and Refresh play into all this?

DynamicVariables - when set to 1 the meter/measure will go through the reload cycle every before every update cycle happens reading ALL options even if none have changed and thus is doing most of the setup over again. This can have a great impact on performance sometimes and can break some plugins. A lot of the time you can avoid using DynamicVariables by being smart and using SetOption.

!SetOption - So as you may know SetOption can be used to change the option of any Measure/Meter, you may also know that using it does not require you to have DynamicVariables=1. This is because whenever you use SetOption it tells the meter/measure to read all the options again but only for the next update cycle. Thus if you know when you need to read the options again you can use SetOption to force it for just the next update cycle and void using DynamicVariables. And if you have multiple changes happen that dont use SetOption you can use [!SetOption NAMEHERE DynamicVariables 0] and it will work the same way.

!Update - Does an update cycle on the measure/meter as soon as possible, ignoring the update rate that the measure/meter should have. This does not update options unless DynamicVariables=1 or a setOption has happened since last update. Thus if you want to save maximum CPU usage you would have UpdateDivider=-1 and use either DV=1 or SetOption when you have options that have changed.


Other somewhat related tidbits:

!Refresh - Does a full refresh of the skin, purging all variables that were made using SetVariable and options that were set using SetOption. Thus it will start from scratch reading from the skin files and external files. Same as right clicking and hitting refresh skin.

!WriteKeyValue - Note that this will not affect until you do a full skin refresh. Thus anytime you use it and want your variable to work now you will need to do !SetVariable and then !WriteKeyValue.
Last edited by tjhrulz on November 9th, 2017, 10:37 pm, edited 1 time in total.
JediWarrior
Posts: 60
Joined: June 18th, 2017, 8:22 pm
Location: Liverpool UK

Re: UpdateDivider

Post by JediWarrior »

Hello tjhrulz,
I've just happened across your explanation of the "UpDateDivider".. Thank you very much I think I understand now(I Think). A really good post and once again Thank You, :welcome: :thumbup: :thumbup: ;-)
Post Reply