}
}
+
+optional<float>
+Job::seconds_since_last_progress_update () const
+{
+ boost::mutex::scoped_lock lm (_progress_mutex);
+ if (!_last_progress_update) {
+ return {};
+ }
+
+ struct timeval now;
+ gettimeofday (&now, 0);
+
+ return seconds(now) - seconds(*_last_progress_update);
+}
+
+
/** Set the progress of the current part of the job.
* @param p Progress (from 0 to 1)
* @param force Do not ignore this update, even if it hasn't been long since the last one.
void set_progress (float, bool force = false);
void sub (std::string);
boost::optional<float> progress () const;
+ boost::optional<float> seconds_since_last_progress_update () const;
std::shared_ptr<const Film> film () const {
return _film;