`
imyer
  • 浏览: 2198 次
  • 性别: Icon_minigender_1
  • 来自: 沈阳
文章分类
社区版块
存档分类
最新评论
文章列表
timer:sleep(T)的实现: receive after T -> ok end 其中有个问题,如果sleep或者after的时间为1000ms时,cpu占用很高,测试代码如下: -module(ctrl). -compile(export_all). start(0, _Ms) -> ok; start(N, Ms) -> timer:sleep(10), spawn(?MODULE, test, [Ms]), start(N-1, Ms). test(Ms) -> test(Ms, 20). test(_Ms, 0) ...
Global site tag (gtag.js) - Google Analytics