We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wsl ubuntu 24.04
在 wsl 中 skynet.now 的时间会相对系统时间越来越慢; 在linux(centos) 系统下不存在这个问题
ps: 对比测试发现wsl ubuntu 24.04 下: CLOCK_REALTIME 与 CLOCK_MONOTONIC 表现不太符合预期
local skynet = require "skynet" local start = os.time() while true do skynet.sleep(100) skynet.error(skynet.now .. "vs" .. os.time() - start) end
[:01000009] 584vs5 [:01000009] 684vs6 [:01000009] 784vs7 [:01000009] 884vs8 [:01000009] 984vs9 [:01000009] 1084vs10 [:01000009] 1184vs14
void skynet_timer_init(void) { ... struct timespec ti; clock_gettime(CLOCK_MONOTONIC, &ti); TI->t1 = (uint32_t)ti.tv_sec; } uint64_t skynet_now(void) { struct timespec ti; clock_gettime(CLOCK_MONOTONIC, &ti); struct timespec ti1; clock_gettime(CLOCK_REALTIME, &ti1); skynet_error(NULL, "pass:%d real:%d", ((uint32_t)ti.tv_sec - TI-> t1), ((uint32_t)ti1.tv_sec - TI->starttime)); return TI->current; }
[:01000009] 1084vs10 [:00000000] pass:10 real:10 ... [:00000000] pass:10 real:11 [:00000000] pass:10 real:11 [:00000000] pass:10 real:11 [:00000000] pass:10 real:11 [:00000000] pass:10 real:11 [:00000000] pass:10 real:11 [:00000000] pass:10 real:11 [:00000000] pass:10 real:11 [:00000000] pass:10 real:11 [:00000000] pass:11 real:11 ... [:00000000] pass:11 real:13 ... [:00000000] pass:11 real:14 ... [:01000009] 1184vs14
The text was updated successfully, but these errors were encountered:
建议把这个问题报告给 wsl 项目。
Sorry, something went wrong.
我不确定是否和这个问题相关:microsoft/WSL#10006
根据wsl 改善方案(重启wsl对时)操作了下; 然并卵。 但是根据他们的问题描述(休眠会导致 CLOCK_MONOTONIC异常),采用重启(windows)大法,暂时隐藏了这个问题
CLOCK_MONOTONIC
btw: 重启后CLOCK_MONOTONIC又快了 ...
wsl本来也并非我们的标准环境,这个问题就先这样。
感谢云大侠
No branches or pull requests
环境
wsl ubuntu 24.04
问题描述
在 wsl 中 skynet.now 的时间会相对系统时间越来越慢; 在linux(centos) 系统下不存在这个问题
ps: 对比测试发现wsl ubuntu 24.04 下: CLOCK_REALTIME 与 CLOCK_MONOTONIC 表现不太符合预期
重新步骤
code
log
c debug code
c log
The text was updated successfully, but these errors were encountered: