X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=utils.h;h=e3f8bcba1306fc7116550a292767895b6c2d9544;hb=97554bbac838f2ed578d81f98e421dac0669e74e;hp=0991fb95333a3eb37111d1968465655f95fb34cf;hpb=fc69cf6af24c0550e55447fc82f01cb6f90c1c42;p=rsem.git diff --git a/utils.h b/utils.h index 0991fb9..e3f8bcb 100644 --- a/utils.h +++ b/utils.h @@ -120,20 +120,6 @@ inline std::string cleanStr(const std::string& str) { return (fr <= to ? str.substr(fr, to - fr + 1) : ""); } -void printTimeUsed(const time_t& a, const time_t& b, const char* filename = "") { - int hh = (b - a) / 3600; - int mm = (b - a) % 3600 / 60; - int ss = (b - a) % 60; - - printf("Time Used : %d h %02d m %02d s\n", hh, mm, ss); - - if (strcmp(filename, "")) { - FILE *fo = fopen(filename, "w"); - fprintf(fo, "Time Used : %d h %02d m %02d s\n", hh, mm, ss); - fclose(fo); - } -} - void genReadFileNames(const char* readFN, int tagType, int read_type, int& s, char readFs[][STRLEN]){ const char tags[3][STRLEN] = {"un", "alignable", "max"}; char suffix[STRLEN]; @@ -156,9 +142,12 @@ void genReadFileNames(const char* readFN, int tagType, int read_type, int& s, ch } } -void exitWithError(const char* errmsg) { - fprintf(stderr, "%s\n", errmsg); - exit(-1); +void printTimeUsed(const time_t& a, const time_t& b, const char* program_name) { + int hh = (b - a) / 3600; + int mm = (b - a) % 3600 / 60; + int ss = (b - a) % 60; + + printf("Time Used for %s : %d h %02d m %02d s\n", program_name, hh, mm, ss); } #endif