摘要:
我在一个项目中用python做业务逻辑部分的代码,但速度不够理想,记录业务逻辑各段代码的用时情况并分析瓶颈就成了必须的工作。于是动手写了下面的ElapsedTime.PY,帮助解决问题。 import sysimport timeclass ElapsedTime: def __init__(self, scope = ""): self.scope_name ... 阅读全文
2005年9月21日
摘要:
在浅尝boost之timer的post里,我提到boost::timer在linux和windows下的不同表现,并用ACE_OS::gettimeofday做了一个替代方案。不过,为了这个功能把ACE的DLL绑到一起,感觉不是那么愉快。 下面是另一个方案,利用boost::date_time库来解决 #include class ElapsedTime{public: ... 阅读全文