Advertisement
Narzew

TimePlusControlLib

Nov 1st, 2012
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.66 KB | None | 0 0
  1. module TimePlusControlLib
  2.         def self.start
  3.                 $tpclt = Time.now
  4.         end
  5.         def self.stop
  6.                 $tpcls = Time.now
  7.         end
  8.         def self.get(a=0)
  9.                 case a
  10.                 when 0 then return Time.now - $tpclt
  11.                 when 1 then return $tpcls - $tpclt
  12.                 else return Time.now - $tpclt
  13.                 end
  14.         end
  15.         def self.clear(a=2)
  16.                 case a
  17.                 when 0 then $tpclt = 0
  18.                 when 1 then $tpcls = 0
  19.                 else
  20.                         $tpclt = 0
  21.                         $tpcls = 0
  22.                 end
  23.         end
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement