📜  无限范围循环 c# 代码示例

📅  最后修改于: 2022-03-11 14:48:57.739000             🧑  作者: Mango

代码示例1
public IEnumerable InfiniteCounter()
{
    int counter = 0;
    while (true)
    {
        unchecked
        {
            yield return counter;
            counter++;
        }
    }
}