Problems with previousState

I would like to know the time difference between the current time and the time of the previousState of an item, if delta > 10 seconds do something.
Problem is that I cannot get the absolute time of the previous item, I’am able to read the state (working fine) by using

logInfo("sonoff195", sonoff195_Switch.previousState.state.toString)

but I need something like

if (now() - sonoff195_Switch.previousState.time) > 10 then .....

Any hints greatly appreciated!


Harry, thanks for the example. This solved my problem !