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: activity.rs
    path of file: ./repos/geph4-client/src/connect/tunnel
    
    the code of the file until where you have to start completion: use event_listener::Event;
use once_cell::sync::Lazy;
use parking_lot::Mutex;
use smol::prelude::*;
use std::time::{Duration, SystemTime};

static LAST_ACTIVITY: Lazy<Mutex<SystemTime>> = Lazy::new(|| Mutex::new(SystemTime::now()));
static ACTIVITY_EVENT: Event = Event::new();

/// Wait till there's activity
pub async fn wait_activity(timeout: Duration) {
    ACTIVITY_EVENT
        .listen()
        .or(async {
            let adjusted_timeout = timeout.min(
                Duration::from_secs_f64(
                    1.5f64
                        .powf(
       
    
pub async fn wait_activity(timeout: Duration) {
    ACTIVITY_EVENT
        .listen()
        .or(async {
            let adjusted_timeout = timeout.min(
                Duration::from_secs_f64(
                    1.5f64
                        .powf(
                            LAST_ACTIVITY
                                .lock()
                                .elapsed()
                                .unwrap_or_else(|_| Duration::from_secs(1000))
                                .as_secs_f64(),
                        )
                        .min(10000.0),
                )
                .max(Duration::from_secs(5)),
            );
            smol::Timer::after(adjusted_timeout).await;
        })
        .await
}