WillFa said: Nick,
Not Nick, but I do have a copy of the source in front of me. >_>
WillFa said: Do the stats displayed in the lower right corner of the trigger edit windows reflect the time it took the RegEx engine to match the pattern, or the time to match and execute the script and finalize the trig?
Looks like it's the time it took to match the pattern. Here's how it looks in my fork. I heavily refactored the regular expression class, but it should work the same, and I barely touched the code in this particular section anyways. At any rate:
LARGE_INTEGER start;
if (App.m_iCounterFrequency)
QueryPerformanceCounter (&start);
int options = App.m_bRegexpMatchEmpty ? 0 : PCRE_NOTEMPTY; // don't match on an empty string
pcre_callout = NULL; // un-set the global pcre_callout() function pointer
int count = pcre_exec(
this->m_program, this->m_extra,
string, strlen (string), start_offset,
options, &offsets[0], offsets.size()
);
if (App.m_iCounterFrequency)
{
LARGE_INTEGER finish;
QueryPerformanceCounter (&finish);
this->iTimeTaken += finish.QuadPart - start.QuadPart;
}
WillFa said: Oh, and is there a way to get similar stats about a plugin?
I believe it's exposed through GetTriggerInfo. There's also a GetPluginTriggerInfo for externally getting at it. Selector 20 for the script invocation count, and 21 for times matched. I can't find a total-time-taken selector, oddly.
EDIT: Yeah, not seeing the time taken accessed anywhere visible from a script, so chances are good that it's not accessible currently. |