package com.sifang.modules.sys.util;

import org.springframework.stereotype.Service;

import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

@Service
public class ScheduledService {

    private static final ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor();

    public void schedule(Runnable runnable, long delay, TimeUnit timeUnit) {
        executorService.schedule(runnable, delay, timeUnit);
    }

}
