Findout how long a job has been running in Quartz

1.6k views Asked by At

I am writing a kind of start - pause - resume - pause - resume -(at regular intervals) kind of job in Quartz. I am using a SimpleTrigger for initial experimentation.

I would like to how I can find the time a job has been running. I looked at the Scheduler class and there were no methods directly to find it.

Could some one suggest me a way of finding how long a job has been running?

Thanks, Abi

1

There are 1 answers

3
jhouse On

Call scheduler.getCurrentlyExecutingJobs() to get the set of job's currently executing (or more precisely to get the JobExecutionContext of each).

Then you can call getFireTime() on the JobExecutionContext to see what time the execution started.