10 static double tParsing = 0;
11 static unsigned int cParsing = 0;
13 static double tLoading = 0;
14 static unsigned int cLoading = 0;
15 static double tBuilding = 0;
16 static unsigned int cBuilding = 0;
18 static struct timeval tmpv1;
19 static struct timeval tmpv2;
23 static void read_procmem(string& memstr) {
26 std::stringstream path;
27 path << "/proc/" << pid << "/status";
29 infile.open (path.str().c_str(), std::ifstream::in);
30 while (infile.good()){
33 memstr = "Could not read memory";
36 int idx = buf.find("VmRSS");
42 memstr = "Could not read memory";
47 #define STARTTIMER() do { \
49 gettimeofday(&tmpv1,NULL); \
52 #define STOPTIMER(x) do { \
53 gettimeofday(&tmpv2,NULL); \
55 (t##x) = ((tmpv2.tv_sec - tmpv1.tv_sec) * 1000000.0 + \
56 (tmpv2.tv_usec - tmpv1.tv_usec))/1000.0; \
60 #define PRINTTIME(s,x) do { \
61 std::cerr << (s) << " : " << (t##x) << "ms" << std::endl; \
62 std::cerr << "Mem use before: " << mem1 << std::endl; \
63 std::cerr << "Mem use after: " << mem2 << std::endl; \