00001 #include "debug_tools.h" 00002 00003 char DEBUG::time_log::str[]={0}; 00004 char DEBUG::mem_log::str[] = {0}; 00005 00006 00007 DEBUG::time_log::time_log(int c, int u) : cpu(c), user(u) { 00008 snprintf(str, 64, "CPU/User(ms) = %4d / %4d",cpu, user); 00009 } 00010 00011 DEBUG:: mem_log:: mem_log(int r, int v) : res(r), virt(v) { 00012 snprintf(str, 64, "Res/Virt(MiB) = %4d / %4d",res, virt); 00013 } 00014 00015 const DEBUG::mem_log DEBUG::check_mem(){ 00016 static ProcInfo_t proc; 00017 gSystem->GetProcInfo(&proc); 00018 return mem_log(proc.fMemResident /1024., proc.fMemVirtual /1024.); 00019 } 00020 00021 DEBUG::time_log DEBUG::check_clock(){ 00022 return check_clock<0xBADBEEF>(); 00023 }