How to detect pulse duration with CMOS circuit
All you'd do is charge a capacitor (C1) with the current pulse. I don't know why you'd need M3 and M4 for that, seeing that neither "adds" any external current sourcing, and I don't see why you'd need M5 or anything connected to that.

The full circuit you need is a single capacitor connected between ground and your pulse source.