MCPcopy Index your code
hub / github.com/FrameworkComputer/inputmodule-rs / clock_cmd

Function clock_cmd

inputmodule-control/src/inputmodule.rs:800–811  ·  view source on GitHub ↗

Render the current time and display. Loops forever, updating every second

(serialdevs: &Vec<String>)

Source from the content-addressed store, hash-verified

798/// Render the current time and display.
799/// Loops forever, updating every second
800fn clock_cmd(serialdevs: &Vec<String>) {
801 loop {
802 let date = Local::now();
803 let current_time = date.format("%H:%M").to_string();
804 println!("Current Time = {current_time}");
805
806 for serialdev in serialdevs {
807 show_string(serialdev, &current_time);
808 }
809 thread::sleep(Duration::from_millis(1000));
810 }
811}
812
813/// Render a string with up to five letters
814fn show_string(serialdev: &str, s: &str) {

Callers 1

serial_commandsFunction · 0.85

Calls 1

show_stringFunction · 0.70

Tested by

no test coverage detected