mirror of
https://github.com/facebook/zstd.git
synced 2025-11-29 00:04:37 -05:00
Merge pull request #3166 from facebook/warning_clockt
display a warning message when using C90 clock_t
This commit is contained in:
commit
f15dd6420c
@ -13,7 +13,7 @@
|
||||
* Tuning parameters
|
||||
****************************************/
|
||||
#ifndef BMK_TIMETEST_DEFAULT_S /* default minimum time per test */
|
||||
#define BMK_TIMETEST_DEFAULT_S 3
|
||||
# define BMK_TIMETEST_DEFAULT_S 3
|
||||
#endif
|
||||
|
||||
|
||||
@ -387,6 +387,13 @@ BMK_benchMemAdvancedNoAlloc(
|
||||
RDG_genBuffer(compressedBuffer, maxCompressedSize, 0.10, 0.50, 1);
|
||||
}
|
||||
|
||||
#if defined(UTIL_TIME_USES_C90_CLOCK)
|
||||
if (adv->nbWorkers > 1) {
|
||||
OUTPUTLEVEL(2, "Warning : time measurements restricted to C90 clock_t. \n")
|
||||
OUTPUTLEVEL(2, "Warning : using C90 clock_t leads to incorrect measurements in multithreading mode. \n")
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Bench */
|
||||
{ U64 const crcOrig = (adv->mode == BMK_decodeOnly) ? 0 : XXH64(srcBuffer, srcSize, 0);
|
||||
# define NB_MARKS 4
|
||||
|
||||
@ -65,6 +65,7 @@ extern "C" {
|
||||
|
||||
#else /* relies on standard C90 (note : clock_t measurements can be wrong when using multi-threading) */
|
||||
|
||||
#define UTIL_TIME_USES_C90_CLOCK
|
||||
typedef clock_t UTIL_time_t;
|
||||
#define UTIL_TIME_INITIALIZER 0
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user