diff --git a/source/libs/function/test/udf1.c b/source/libs/function/test/udf1.c index b53f82c3e99502d0316410e0c388f4e3503ced5f..5be18af553498bf2b05607b69223c302d3826fae 100644 --- a/source/libs/function/test/udf1.c +++ b/source/libs/function/test/udf1.c @@ -1,8 +1,12 @@ #include #include #include +#ifdef LINUX #include - +#endif +#ifdef WINDOWS +#include +#endif #include "taosudf.h" @@ -37,17 +41,11 @@ DLL_EXPORT int32_t udf1(SUdfDataBlock* block, SUdfColumn *resultCol) { } } //to simulate actual processing delay by udf +#ifdef LINUX + usleep(1 * 1000); // usleep takes sleep time in us (1 millionth of a second) +#endif #ifdef WINDOWS - HANDLE timer; - LARGE_INTEGER interval; - interval.QuadPart = (10 * 1000); - - timer = CreateWaitableTimer(NULL, TRUE, NULL); - SetWaitableTimer(timer, &interval, 0, NULL, NULL, 0); - WaitForSingleObject(timer, INFINITE); - CloseHandle(timer); -#else - usleep(1000); + Sleep(1); #endif return 0; } \ No newline at end of file