require'rubygems'require'sinatra'require'rufus/scheduler'configuredoscheduler=Rufus::Scheduler.start_new# 启动之后每分钟打印输出当前时间到文件中scheduler.every'1m'doFile.open(File.dirname(__FILE__)+'/log.txt',"a+")file.puts"start work at #{Time.new.strftime('%Y-%m-%d %H:%M:%S')}"endendendget'/'do"start work at #{Time.new.strftime('%Y-%m-%d %H:%M:%S')}"end
require'sinatra'require'rufus/scheduler'configuredoscheduler=Rufus::Scheduler.new# testscheduler.every'1s'doputsTime.now.to_iendendget'/'do"start work at #{Time.new.strftime('%Y-%m-%d %H:%M:%S')}"end