Here's an idea: How about making PerfTimer a struct so it's allocated on the stack? You'd just need to move the thread local to a helper static class. I think.