~ubuntu-branches/ubuntu/trusty/ruby1.9/trusty

« back to all changes in this revision

Viewing changes to sample/time.rb

  • Committer: Bazaar Package Importer
  • Author(s): Stephan Hermann
  • Date: 2008-05-16 12:37:06 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20080516123706-r4llcdfd35aobrjv
Tags: 1.9.0.1-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Robustify check for target_os, fixing build failure on lpia.
* debian/control:
  - ruby1.9 pkg: moved rdoc1.9 suggestion to depends. (LP: #228345)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /usr/local/bin/ruby
2
 
cmd = ARGV.join(" ")
 
1
#! /usr/bin/env ruby
 
2
 
3
3
b = Time.now
4
 
system(cmd)
 
4
system(*ARGV)
5
5
e = Time.now
6
 
ut, st, cut, cst = Time.times.to_a
7
 
total = (e - b).to_f
8
 
STDERR.printf "%11.1f real %11.1f user %11.1f sys\n", total, cut, cst
 
6
 
 
7
tms = Process.times
 
8
real = e - b
 
9
user = tms.cutime
 
10
sys = tms.cstime
 
11
 
 
12
STDERR.printf("%11.1f real %11.1f user %11.1f sys\n", real, user, sys)