summaryrefslogtreecommitdiffstats
path: root/src/display/ui.rs
diff options
context:
space:
mode:
authorRupert Rutledge <eosis2 [at] gmail.com>2020-04-26 14:12:06 +0100
committerRupert Rutledge <eosis2 [at] gmail.com>2020-04-26 14:12:06 +0100
commit1953c8bb8b7ec3a84e1b238421c0320f9e0b3391 (patch)
tree0fe8ea191ca7175a3346e5cbeb72a35980d91211 /src/display/ui.rs
parent648eb0a66906035858794977cfaa2a03a75f0210 (diff)
Working implementation of the elapsed time of the capture
This elapsed time pauses during pause sections and restarts on resumption. Ongoing: - Consider a RwLock instead of a Mutex for the elapsed time and cumulative time values, as these are only written by the UI thread and read elsewhere. - Combine the cumulative time and start times into a struct for clarity. - Separate out the elapsed time from the Bandwidth, as they are separate considerations, leading to altering the rendering of the header to write bandwidth and elapsed time separately.
Diffstat (limited to 'src/display/ui.rs')
-rw-r--r--src/display/ui.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/display/ui.rs b/src/display/ui.rs
index 68f133a..cd87786 100644
--- a/src/display/ui.rs
+++ b/src/display/ui.rs
@@ -79,7 +79,7 @@ where
));
}
}
- pub fn draw(&mut self, paused: bool, show_dns: bool) {
+ pub fn draw(&mut self, paused: bool, show_dns: bool, elapsed_time: std::time::Duration) {
let state = &self.state;
let children = self.get_tables_to_display();
self.terminal
@@ -87,6 +87,7 @@ where
let size = frame.size();
let total_bandwidth = TotalBandwidth {
state: &state,
+ elapsed_time,
paused,
};
let help_text = HelpText { paused, show_dns };