user3090011
user3090011

Reputation: 31

Task scheduling with Quartz

I am using Quartz for scheduling parallel tasks, How can I get job running time in Quartz?

Upvotes: 0

Views: 386

Answers (1)

zerologiko
zerologiko

Reputation: 2111

JobExecutionContext expose a some useful methods:

  • getJobRunTime: returns the time only after the job has actually completed (you may want to use a JobListener to call it when job finished the execution).
  • getFireTime: get the actual time the job started, so you can the current Date to calculate the elapsed time (you can call this method even inside the Job itself).

Note: To know "how long it WILL takes to run one job" you have to implement on your own doing some simple math to get the % of completion. Quartz itself doesn't have such a feature.

Upvotes: 1

Related Questions