Compare duration of a timer field to a value

I am trying to compare the values of certain fields to prevent submission if some exceed others.
I’ve got this working fine (using JS) for numeric fields, however I need to compare the duration of a timer field (time only - no date) to a number (eg 4.5 hours compared to “5”).
I’ve hunted all the documentation I can find but I can’t find how to return the “duration” variable from the timer field. In fact I haven’t worked out how to return any info (eg from hours/minutes) from the timer field.
Any help would be appreciated thanks.

I have found a solution to this issue now.