GIMP Chat http://gimpchat.com/ |
|
timer plug-in acts sort of like a stop watch w/wo TRACKING CODE http://gimpchat.com/viewtopic.php?f=9&t=20651 |
Page 1 of 1 |
Author: | trandoductin [ Sat Nov 25, 2023 8:55 pm ] |
Post subject: | timer plug-in acts sort of like a stop watch w/wo TRACKING CODE |
Since I was interested in how much time plug-ins save compared to manual process, I wrote this timer-tt.py plug-in If you map it to shortcut (I use Ctrl+T) by going to Edit/Preferences>Interface then scroll on right down to Shortcuts and search for my timer plugin and just mapped it to Ctrl+T (but Ctrl+T in GIMP toggles the show selection flag, I never use that so it's fine for me). Then every, you hit Ctrl+T it gives you the time since you last Ctrl+T-ed. Sort of like a stop watch internally to gimp. I'll just output number in seconds out to the error console using pdb.gimp_message. Code: Select all #!/usr/bin/env python |
Author: | trandoductin [ Sun Nov 26, 2023 6:07 pm ] |
Post subject: | Re: timer plug-in acts sort of like a stop watch |
This version has TRACKING code. TRACKING only increments a single counter each time the plug-in is called/used. Code: Select all #!/usr/bin/env python here's the tracking code portion Code: Select all # TRACKING CODE STARTS ================================================================================ it defines one function call hit_it() which is called once by the plug-in itself that hits the database and increases a single counter with TRACKING_VARNAME = 'timertt' for a different plug-in i would change the timertt to something else. and then anyone can view these tracked single counters on GIMP Plug-in Stats Usage If you plan to use this tracking for other plug-ins it'll work and define the counter the first time you run it as 1 if you define your own TRACKING_VARNAME. but it won't show up on the above stats page until I add it to the page. But you can view the TRACKING_VARNAME you're interested in by going to https://tinmantaken.blogspot.com/2023/11/view-gimp-plug-in-usage-stats.html?var=timertttest just replace timertttest with your TRACKING_VARNAME value to temporarily see the value before it's hardcode added to the stats page. There is also commented out line at end of TRACKING CODE that you uncomment and see the value using pdb.gimp_message. this tracking call is called when the plug-in isn't doing time calculation so the timer functionality is still as accurate as before. |
Page 1 of 1 | All times are UTC - 5 hours [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |