What is the difference between C.sleep() and time.Sleep()?

Technology CommunityCategory: GolangWhat is the difference between C.sleep() and time.Sleep()?
VietMX Staff asked 3 years ago
  • C.sleep() invokes syscall sleep, which causes idle threads
  • time.Sleep() is optimized for goroutine so syscall sleep is not involved.