예제 #1
0
파일: perfbar.cpp 프로젝트: zorbathut/glorp
 void perfbarReset() {
   if(!pstack.empty()) {
     dprintf("Horribly broken perfstack! Something is very wrong. Oh dearie, dearie me.\n");
     pstack = stack<pair<const PerfStack *, PerfChunk> >();  // bizarre syntax needed because stack doesn't have .clear()
   }
   pchunks.clear();
   start = timeMicro();
 }
예제 #2
0
파일: perfbar.cpp 프로젝트: zorbathut/glorp
 PerfStack::PerfStack(float r, float g, float b) {
   PerfChunk pch;
   pch.start = timeMicro();
   pch.r = r;
   pch.g = g;
   pch.b = b;
   pch.indent = pstack.size();
   pstack.push(make_pair(this, pch));
 }
예제 #3
0
파일: perfbar.cpp 프로젝트: zorbathut/glorp
 PerfStack::~PerfStack() {
   if(pstack.top().first != this) {
     dprintf("Horribly broken perfstack! Something is very wrong. Oh dearie, dearie me.\n");
     return;
   }
   PerfChunk pch = pstack.top().second;
   pstack.pop();
   pch.end = timeMicro();
   pchunks.push_back(pch);
 }
예제 #4
0
void delayMicro(uint32_t us)
{
    uint32_t now = timeMicro();
    while (timeMicro() - now < us);
}