You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2020/03/27 04:48:08 UTC

[GitHub] [incubator-doris] vagetablechicken commented on a change in pull request #3211: use SleepFor() instead of usleep()

vagetablechicken commented on a change in pull request #3211: use SleepFor() instead of usleep()
URL: https://github.com/apache/incubator-doris/pull/3211#discussion_r399033631
 
 

 ##########
 File path: be/src/exprs/utility_functions.cpp
 ##########
 @@ -17,27 +17,25 @@
 
 #include "exprs/utility_functions.h"
 
-#include "exprs/expr.h"
 #include "exprs/anyval_util.h"
-#include "util/debug_util.h"
+#include "exprs/expr.h"
 #include "runtime/tuple_row.h"
+#include "util/debug_util.h"
 
 namespace doris {
 
-void UtilityFunctions::init() {
-}
+void UtilityFunctions::init() {}
 
 StringVal UtilityFunctions::version(FunctionContext* ctx) {
     return AnyValUtil::from_string_temp(ctx, "5.1.0");
 }
 
-BooleanVal UtilityFunctions::sleep(
-        FunctionContext* ctx, const IntVal& milliseconds) {
+BooleanVal UtilityFunctions::sleep(FunctionContext* ctx, const IntVal& milliseconds) {
     if (milliseconds.is_null) {
         return BooleanVal::null();
     }
-    usleep(milliseconds.val * 1000 * 1000);
+    usleep(milliseconds.val * 1000 * 1000); // TODO(hw): ms * 1000 * 1000 = ns
 
 Review comment:
   I'm confused about this. This usleep() use ns as its argument. Is it a mistake?
   I should change it to
   `SleepFor(MonoDelta::FromMilliseconds(milliseconds.val)` ?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org