ThinkSSL🔒 一键申购 5分钟快速签发 30天无理由退款 购买更放心 广告
# Coroutine::exist [TOC] > 需要v4.3.0及以上 判断指定协程是否存在 ## API ~~~ function Coroutine::exist() : bool ~~~ ## 例子 ~~~ go(function () { go(function () { go(function () { Co::sleep(0.001); var_dump(Co::exists(Co::getPcid())); // 1: true }); go(function () { Co::sleep(0.003); var_dump(Co::exists(Co::getPcid())); // 3: false }); Co::sleep(0.002); var_dump(Co::exists(Co::getPcid())); // 2: false }); }); ~~~