Share this post

Link to post

Share on other sites

BrewManNH 1,149

BrewManNH 1,149

Reasking the same question just rewording it isn't going to make it magically easier.

Delve into the Lua script that is used to insert the trace lines that gruntyDatsun mentioned and modify it to insert timer functions instead, that would probably be the easiest way.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Share this post

Link to post

Share on other sites

BrewManNH 1,149

BrewManNH 1,149

Now I got it... but it would be unsatisfatory to me because I want permanently keep it ON even while working on my scripts.

The purpose are to be ALWAYS alerted when an instruction that takes too much time (for example an _IENavigate page load, that takes different time each time...)

No idea what you're looking for then, you can't time a script unless it's running, and from what you just wrote you want to time a script as you're writing it? How do you plan on "being alerted" when it "takes too much time"? Too much time is extremely vague and has no meaning out of context, and being alerted can have many meanings depending upon what method you intend the alert to use.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Share this post

Link to post

Share on other sites

Imbuter2000 0

Imbuter2000 0

No idea what you're looking for then, you can't time a script unless it's running, and from what you just wrote you want to time a script as you're writing it? How do you plan on "being alerted" when it "takes too much time"? Too much time is extremely vague and has no meaning out of context, and being alerted can have many meanings depending upon what method you intend the alert to use.

ahah no, I just meant that I don't want to cancel and relaunch something so intrusive like an ADD TRACE LINES each time after I add a line of code. It would be like a mess and time-expensive to work with this "weight"!

Share this post

Link to post

Share on other sites

BrewManNH 1,149

BrewManNH 1,149

Unless you're willing to "do the work" by putting a timer before and after every line in your code, then the answer would have to be no you can't time the lines of your script in any meaningful way.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Share this post

Link to post

Share on other sites

BrewManNH 1,149

BrewManNH 1,149

I personally think that, unless you're just timing chunks of code, timing your script isn't going to give you very much meaningful information. If you think the script is running too slowly in a certain section of the code, time that part and see if you can optimize it. Timing every single line is going to give you too much information, and very little of it will be useful.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Share this post

Link to post

Share on other sites

Imbuter2000 0

Imbuter2000 0

For example, I use many XML msxml6.dll COM calls to parse third-party websites
and I want to be alerted (in a alert.log file) when any XML parse takes more than 1 second.
The third-party websites can change and therefore the XML parse time can change in future...

Is the only option to add a timer line of code after each XML parse command?
or to create a corresponding function for every msxml command (containing a timer)?!

Share this post

Link to post

Share on other sites

Melba23 2,865

Melba23 2,865

I find this UDF very handy for timing the functions and reasonably sized code chunks in some of my longer scripts.

M23

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort---- Sort arrays on multiple columnsChooseFileFolder---- Single and multiple selections from specified path treeview listingDate_Time_Convert-- Easily convert date/time formats, including the language usedExtMsgBox--------- A highly customisable replacement for MsgBoxGUIExtender-------- Extend and retract multiple sections within a GUIGUIFrame---------- Subdivide GUIs into many adjustable framesGUIListViewEx------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx------ Check/clear parent and child checkboxes in a TreeViewMarquee----------- Scrolling tickertape GUIsNoFocusLines------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify------------- Small notifications on the edge of the displayScrollbars----------Automatically sized scrollbars with a single commandStringSize---------- Automatically size controls to fit textToast-------------- Small GUIs which pop out of the notification area