In state machines(Animation Blueprint), how to get the time spent in a state?

Thanks for the timer idea. i will look in to it. Maybe there is a simpler way to do it