Abort a task after a given time

I have a “Halting problem” type of problem - I am not certain if a job will be finished or run just infinitely.
Is there a elegant way to tell hangfire to kill a task once a configured timeout period is passed? I googled a lot, the closest I found was this one: https://github.com/HangfireIO/Hangfire/pull/188 - but this only kills a job if it was started too late.

Any pointers?

Thanks!
Max