Implementing WaitForFixedSeconds

I want to pause my coroutines for some seconds, using fixed update for maximum accuracy. The code below works fine but is too verbose:

var endTime = Time.time + pauseDuration;
while(endTime > Time.time) {
    yield return new WaitForFixedUpdate();
}

Ideally this would be a YieldInstruction, so I could just write yield return new WaitForFixedSeconds(pauseDuration). However I’m not sure how to force an IEnumerator implementation to execute in the fixed-update scheduler. I’ve tried this to no avail:

class WaitForFixedSeconds : IEnumerator {

    public object Current { get { return new WaitForFixedUpdate(); } }
    public bool MoveNext() { return Time.time > endTime; }
    public void Reset() {}

    public WaitForFixedSeconds(float delay) {
        endTime = Time.time + delay;
    }

    float endTime;
}

How can I write a WaitForFixedSeconds YieldInstruction?

Why not just use

for (int i = 0; i < NumberOfSeconds * 50; i++){ yield return new WaitForFixedUpdate(); }?

Turns out I just had a typo in my original IEnumerator attempt. Thanks to @steo for the fix!

using System.Collections;
using UnityEngine;

// like WaitForSeconds but happens in the fixed update
class WaitForFixedSeconds : IEnumerator {

    public object Current { get { return s_fixedUpdateWaiter; } }

    public bool MoveNext() {
            return Time.time < endTime;
    }

    public void Reset() {}

    public WaitForFixedSeconds(float delay) {
            endTime = Time.time + delay;
    }

    //////////////////////////////////////////////////

    readonly float endTime;

    static readonly WaitForFixedUpdate s_fixedUpdateWaiter = new WaitForFixedUpdate();
}

added static WaitForFixedUpdate to avoid dem allocs