Merge pull request #493 from lz4/statusLine

fixed DISPLAYUPDATE()
This commit is contained in:
Yann Collet 2018-04-06 15:33:28 -07:00 committed by GitHub
commit 158c5840e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -94,9 +94,12 @@
static int g_displayLevel = 0; /* 0 : no display ; 1: errors ; 2 : + result + interaction + warnings ; 3 : + progression; 4 : + information */
#define DISPLAYUPDATE(l, ...) if (g_displayLevel>=l) { \
if (((clock_t)(g_time - clock()) > refreshRate) || (g_displayLevel>=4)) \
{ g_time = clock(); DISPLAY(__VA_ARGS__); \
if (g_displayLevel>=4) fflush(stderr); } }
if ( ((clock() - g_time) > refreshRate) \
|| (g_displayLevel>=4) ) { \
g_time = clock(); \
DISPLAY(__VA_ARGS__); \
if (g_displayLevel>=4) fflush(stderr); \
} }
static const clock_t refreshRate = CLOCKS_PER_SEC / 6;
static clock_t g_time = 0;