/
Usleep Misuse
Usleep Misuse
Calling risky function "usleep()" (SECURE_CODING).
secure_coding:Using "usleep" can cause a performance problem when done incorrectly.
For better performance , we recommends NOT to use less than 10,000 us.' if you use 10,000 us or more you can ignore this warning.
Bad Code | void my_func(void) { usleep(500); int value =1000; usleep(value); } |
Clean Code | void my_func(void) { usleep(50000); int value =20000; usleep(value); } |
, multiple selections available,
Related content
std::basic_string type misused(C++98)
std::basic_string type misused(C++98)
More like this
1st Array Index Out Of Bounds
1st Array Index Out Of Bounds
More like this
2nd Array Index Out Of Bounds
2nd Array Index Out Of Bounds
More like this
Signed/Unsigned Assignment Error
Signed/Unsigned Assignment Error
More like this
Negative atoi() return value is used in Array Index
Negative atoi() return value is used in Array Index
More like this
No Free of Return Value
No Free of Return Value
More like this