So I'm analyzing reports on my application and I'm using an average process time of 3.6% which really ain't bad at all, but I'm going to be running multiple applications so I want to optimize as much as possible.
What does my bandage function do? It's started in a new thread, once it's called it'll bandage the person then wait for completion. When it completes it sets a boolean to false and the thread exits. Next time a bandage check is made it checks the boolean before running the bandage function.
Here's the function I'm analyzing...
static void bandage(Creature HealTarget)
{
if (HealTarget.Distance < 2 && bandages != null)
{
bandaging = true;
bandages.Use();
Stealth.Default.WaitTargetObject(HealTarget.ID);
response("using bandage on " + HealTarget.Name + ".");
Stealth.Default.WaitJournalLine(DateTime.Now, "You finish applying the bandages|You apply the bandages, but they barely help|You heal what little damage your patient had|You did not stay close enough to heal your patient|That is too far away", 15000);
}
bandaging = false;
}

Digging into -> Combot.Routine.Main

Over half the processing time used in the main routine is checking for health, which is understandable.
Digging into ->Combat.Heal.checkHealth

There's only one called function in this path and it's Bandage. We can see that WaitJournalLine is using up the most processing time in this function which is also understandable. Digging into WaitJournalLine, I can see that it's using InJournalBetweenTimes.
Just looking for some suggestions from you guys, I don't have much experience with ScriptDotNet2.dll and documentation is outdated. Wasn't sure if anyone knew of a better way to do this

Basically 30% of the application processing time is spent checking the Journal and I'd like to reduce that.
Thanks!