linux下定时最小为1分钟,怎么能按秒定时呢,求解
看下之前写的一个开源项目,可以满足你的需求
https://github.com/hfcorriez/croon
写个 daemon 程序,类似这样子:
#!/bin/sh
while true; do
do_work &
sleep 5
done
或者有 systemd 的话,systemd.timer 是支持秒级精度的。
linux下定时最小为1分钟,怎么能按秒定时呢,求解
看下之前写的一个开源项目,可以满足你的需求
https://github.com/hfcorriez/croon
写个 daemon 程序,类似这样子:
#!/bin/sh
while true; do
do_work &
sleep 5
done
或者有 systemd 的话,systemd.timer 是支持秒级精度的。