You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: deadline_writer.rs
    path of file: ./repos/glommio/examples
    
    the code of the file until where you have to start completion: use futures_lite::io::AsyncBufReadExt;
use glommio::{
    controllers::{DeadlineQueue, DeadlineSource},
    io::stdin,
    prelude::*,
};
use std::{
    cell::Cell,
    future::Future,
    pin::Pin,
    rc::Rc,
    time::{Duration, Instant},
};
use yansi::Paint;

fn burn_cpu(dur: Duration) {
    let now = Instant::now();
    while now.elapsed() < dur {}
}

struct IntWriter {
    deadline: Duration,
    start: Instant,
    count_target: usize,
    count: Cell<usize>,
    next_print: Cell<Duration>,
    count_at_last_print: Cell<usize>,

    last_tq_runtime: Cell<Duration>,
    last_ex_runtime: Cell<Duration>,
}

impl IntWriter {
    fn new(count_target: usize, deadline: Duration) -> Rc<IntWriter> {
        Rc::new(IntWriter {
            start: Instant::now(),
            deadline,
            count_target,
            count: Cell::new(0),
            next_print: Cell::new(Duration::from_secs(1)),
            count_at_last_print: Cell::new(0),
            last_tq_runtime: Cell::new(Duration::from_nanos(0)),
            last_ex_runtime: Cell
    
    async fn write_int(self: Rc<Self>) -> Duration {
        let my_handle = glommio::executor().current_task_queue();

        loop {
            let me = self.count.get();
            let elapsed = self.start.elapsed();
            if me >= self.count_target {
                return elapsed;
            }
            self.count.set(me + 1);
            if elapsed > self.next_print.get() {
                let tq_stats = glommio::executor().task_queue_stats(my_handle).unwrap();

                let tq_runtime = tq_stats.runtime();
                let tq_delta = tq_runtime - self.last_tq_runtime.get();
                let ex_runtime = glommio::executor().executor_stats().total_runtime();
                let ex_delta = ex_runtime - self.last_ex_runtime.get();

                let ratio = self.count.get() as f64 / self.count_target as f64 * 100.0;
                let intratio = self.count.get() - self.count_at_last_print.get();

                let cpuratio = 100.0 * tq_delta.as_secs_f64() / ex_delta.as_secs_f64();

                println!(
                    "{}: Wrote {} ({}%), {:.0} int/s, scheduler shares: {} , {:.2} % CPU",
                    Paint::blue(format!("{}s", elapsed.as_secs())),
                    self.count.get(),
                    Paint::new(format!("{:.0}", ratio)).bold(),
                    intratio,
                    Paint::new(tq_stats.current_shares().to_string()).bold(),
                    cpuratio
                );
                self.next_print
                    .set(self.next_print.get() + Duration::from_secs(1));
                self.count_at_last_print.set(self.count.get());
                self.last_tq_runtime.set(tq_runtime);
                self.last_ex_runtime.set(ex_runtime);
            }

            burn_cpu(Duration::from_micros(500));
            glommio::executor().yield_task_queue_now().await;
        }
    }