Timing a macro

Discuss macro implementations, ask for macro help (to share your creations, see User Creations, probably either Campaign Frameworks or Drop-in Resources).

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice

Post Reply
xavram
Dragon
Posts: 891
Joined: Tue Apr 20, 2010 8:22 pm

Timing a macro

Post by xavram »

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?

User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Re: Timing a macro

Post by Full Bleed »

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?
I'm pretty sure that there is a homemade function around here that will sort of do that...

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."

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Timing a macro

Post by wolph42 »

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

Post Reply

Return to “Macros”