eb09b58ec1c838bc315f37322872369200ffe7b9 kent Sun Dec 19 08:37:56 2021 -0800 Added uglyt function, like uglyTime, but without the html formatting, so can use it in command line utilities. diff --git src/lib/common.c src/lib/common.c index 4117d43..367ed60 100644 --- src/lib/common.c +++ src/lib/common.c @@ -3627,30 +3627,48 @@ { static long lastTime = 0; long time = clock1000(); va_list args; va_start(args, label); if (label != NULL) { fprintf(stdout, ""); vfprintf(stdout, label, args); fprintf(stdout, ": %ld millis
\n", time - lastTime); } lastTime = time; va_end(args); } +void uglyt(char *label, ...) +/* Print label and how long it's been since last call. Call with + * a NULL label to initialize. */ +{ +static long lastTime = 0; +long time = clock1000(); +if (label != NULL) + { + va_list args; + va_start(args, label); + vfprintf(stdout, label, args); + fprintf(stdout, ": %ld ms\n", time - lastTime); + lastTime = time; + va_end(args); + } +} + + void makeDirs(char* path) /* make a directory, including parent directories */ { char pathBuf[PATH_LEN]; char* next = pathBuf; strcpy(pathBuf, path); if (*next == '/') next++; while((*next != '\0') && (next = strchr(next, '/')) != NULL) { *next = '\0'; makeDir(pathBuf);