+ // Find min and max timestamp of all input frames that have a timestamp.
+ steady_clock::time_point min_ts = steady_clock::time_point::max(), max_ts = steady_clock::time_point::min();
+ for (const auto &ts : received_ts.ts) {
+ if (ts > steady_clock::time_point::min()) {
+ min_ts = min(min_ts, ts);
+ max_ts = max(max_ts, ts);
+ }
+ }
+ duration<double> lowest_latency = now - max_ts;
+ duration<double> highest_latency = now - min_ts;
+