Do constant scripts put pressure on the CPU?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
aliztori
Posts: 119
Joined: 19 Jul 2022, 12:44

Do constant scripts put pressure on the CPU?

Post by aliztori » 26 Nov 2022, 06:46

Hi, I have a question about persistent scripts
For example, if we have such a code

Code: Select all

CoordMode, Mouse
settimer, Label, 250 ;or 50 Maybe even 0
Return

Label:

MouseGetPos, x,y
If (y < 50 && x < 50)
	ToolTip, TopLeft Corner ;It can be replaced by something like running a program or windows or closing a window
Return
If this is permanent
CPU or system efficiency is not pressured?
Is it possible to perform unusual or normal tasks such as editing or gaming by running this script at the same time?
Because the system is taking the mouse position almost constantly
And pay attention to this important point that this is a simple example and may even be much more than checking the mouse position

User avatar
mikeyww
Posts: 26883
Joined: 09 Sep 2014, 18:38

Re: Do constant scripts put pressure on the CPU?

Post by mikeyww » 26 Nov 2022, 07:12

Hello,

Resources used depend on the specific code. You can test your own question by running your script, and examining the Performance tab of Windows Task Manager.

A non-persistent script exits when Return or end of script is reached.

https://www.autohotkey.com/docs/commands/_Persistent.htm

In many instances, a timer frequency of 250 will have no functional impact on other tasks of the user. You are the person who determines it by running the script and your other programs.

If needed, AHK can be used to alter a script's priority.

teadrinker
Posts: 4326
Joined: 29 Mar 2015, 09:41
Contact:

Re: Do constant scripts put pressure on the CPU?

Post by teadrinker » 26 Nov 2022, 07:24

Interesting info about continuously working timers.
Any periodic activity with a rate faster than one minute incurs the scrutiny of the Windows performance team, because periodic activity prevents the CPU from entering a low-power state.

Post Reply

Return to “Ask for Help (v1)”