Function __delay_ms

Source
pub fn __delay_ms(ms: u64)
Expand description

Delays the program execution for the specified number of milliseconds.

Examples found in repository?
examples/dlog.rs (line 133)
127fn showcase_log_use_cases() {
128    println!("\n{}", "Practical Use Cases:".style(Style::Bold).style(Style::Italic));
129    
130    // Simulating an application startup
131    info!("Application starting up...");
132    debug!("Initializing modules...");
133    __delay_ms(500);
134    info!("Database connection established");
135    __delay_ms(300);
136    // warn!("Config file not found, using default settings");
137    __delay_ms(200);
138    error!("Failed to load user preferences");
139    info!("Application startup complete");
140
141    // Simulating a function call
142    debug!("Entering function process_data()");
143    __delay_ms(100);
144    trace!("Processing item 1 of 3");
145    __delay_ms(50);
146    trace!("Processing item 2 of 3");
147    __delay_ms(50);
148    trace!("Processing item 3 of 3");
149    __delay_ms(100);
150    debug!("Exiting function process_data()");
151
152    info!("Data processing completed successfully");
153
154    // same as above but now use a tuple to store the macro type, message, and delay, then iterate over it
155
156    // logs.iter().for_each(|(log, msg, delay)| {
157    //     log!("{}", msg);
158    //     __delay_ms(*delay);
159    // });
160
161}