Timing a macro
Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice
Timing a macro
I have a macro that generates the players character sheets. It works just fine but its fairly slow (3-4 seconds). Is there any way to time sections of the macro, to determine what portions of it are slow? Like some kind of GetUTCNow at line X, then another GetUTCNow at line Z, then subtract one from the other?
- Full Bleed
- Demigod
- Posts: 4736
- Joined: Sun Feb 25, 2007 11:53 am
- Location: FL
Re: Timing a macro
I'm pretty sure that there is a homemade function around here that will sort of do that...xavram wrote:I have a macro that generates the players character sheets. It works just fine but its fairly slow (3-4 seconds). Is there any way to time sections of the macro, to determine what portions of it are slow? Like some kind of GetUTCNow at line X, then another GetUTCNow at line Z, then subtract one from the other?
But my guess is that you're probably calculating a lot of stuff every time you open your character sheet. You can drastically improve your performance by caching information that you character sheet displays (by putting that info into no-calc properties, string prop lists, or a json) and then just read that data when opening the sheet instead of doing any calculation.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."
Re: Timing a macro
Coaching stuff is explained in one of the links youll find in the HELP Linked in my sig. Timing can be checked by Turing on the macro log and check the log. See debugging also in that link
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS