Can I query animCurve time value(s) by output value?

If I have an animation curve, is there a way to figure out at which time/input value it outputs a certain value?

I want to do this in an expression (to see how many frames from the last whole output value I am), so looping through all the time values on a curve isn’t my first choice.

I haven’t been able to find anything that suggests there’s a function for this, but I’m hoping.

You can ignore this question :confused:

I ended up storing the time value of the curve at an outValue of 0 and once the outvalue was >= prevOutValue++, storing that frame. Works well enough.