libpgf: the time measurement in pgf-translate should be made after pgf_parse_result for more accurate timing

This commit is contained in:
kr.angelov
2012-02-28 13:14:24 +00:00
parent dcbeb63849
commit 4ddf24429b

View File

@@ -129,14 +129,14 @@ int main(int argc, char* argv[]) {
tok = strtok(NULL, " \n");
}
// Now begin enumerating the resulting syntax trees
GuEnum* result = pgf_parse_result(parse, ppool);
clock_t end = clock();
double cpu_time_used = ((double) (end - start)) / CLOCKS_PER_SEC;
printf("%.2f sec\n", cpu_time_used);
// Now begin enumerating the resulting syntax trees
GuEnum* result = pgf_parse_result(parse, ppool);
while (true) {
PgfExpr expr = gu_next(result, PgfExpr, ppool);
// The enumerator will return a null variant at the