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: time.rs
    path of file: ./repos/Ambient/crates/native_std/src/uncategorized
    
    the code of the file until where you have to start completion: //! Provides time related functionality like Clocks and TimeInfo. Also extends Duration for easier
//! construction like 5.secs().
use ambient_sys::time::Instant;
use std::time::Duration;

/// Measures high precision time
#[derive(Debug, Clone)]
pub struct Clock {
    start: Instant,
}

impl Clock {
    // Creates and starts a new clock
    pub fn new() -> Self {
        Clock {
            start: Instant::now(),
        }
    }

    // Returns the elapsed time
    pub fn elapsed(&self) -> Duration {
        Instant::now() -
    
pub fn pretty_duration(duration: Duration) -> String {
    let mut secs = duration.as_secs();
    if secs == 0 {
        return format!("{} ms", duration.as_millis());
    }

    let years = secs / (86400.0 * 365.2422) as u64;
    secs %= (86400.0 * 365.2422) as u64;

    let days = secs / 86400;
    secs %= 86400;

    let hours = secs / 3600;
    secs %= 3600;

    let minutes = secs / 60;
    secs %= 60;

    let mut res = Vec::new();

    if years > 0 {
        res.push(format!("{years} years"))
    }

    if days > 0 {
        res.push(format!("{days} days"))
    }

    if years == 0 && days == 0 {
        if hours > 0 {
            res.push(format!("{hours} hours"))
        }

        if minutes > 0 {
            res.push(format!("{minutes} minutes"))
        }

        if secs > 0 {
            res.push(format!("{secs} seconds"))
        }
    }

    res.join(" ")
}