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 198)
187fn showcase_log_use_cases() {
188 println!(
189 "\n{}",
190 "Practical Use Cases:"
191 .style(Style::Bold)
192 .style(Style::Italic)
193 );
194
195 // Simulating an application startup
196 info!("Application starting up...");
197 debug!("Initializing modules...");
198 __delay_ms(500);
199 info!("Database connection established");
200 __delay_ms(300);
201 // warn!("Config file not found, using default settings");
202 __delay_ms(200);
203 error!("Failed to load user preferences");
204 info!("Application startup complete");
205
206 // Simulating a function call
207 debug!("Entering function process_data()");
208 __delay_ms(100);
209 trace!("Processing item 1 of 3");
210 __delay_ms(50);
211 trace!("Processing item 2 of 3");
212 __delay_ms(50);
213 trace!("Processing item 3 of 3");
214 __delay_ms(100);
215 debug!("Exiting function process_data()");
216
217 info!("Data processing completed successfully");
218
219 // same as above but now use a tuple to store the macro type, message, and delay, then iterate over it
220
221 // logs.iter().for_each(|(log, msg, delay)| {
222 // log!("{}", msg);
223 // __delay_ms(*delay);
224 // });
225}