[問題] 在ruby下的sample的time指令
請問一下這一個是用來測試執行時間嗎
time.rb
#! /usr/local/bin/ruby
cmd = ARGV.join(" ")
b = Time.now
system(cmd)
e = Time.now
ut, st, cut, cst = Time.times.to_a
total = (e - b).to_f
STDERR.printf "%11.1f real %11.1f user %11.1f sys\n", total, cut, cst
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 222.250.106.144
推
08/02 21:24, , 1F
08/02 21:24, 1F
Ruby 近期熱門文章
PTT數位生活區 即時熱門文章