OSDN Git Service
(root)
/
shogi-server
/
shogi-server.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Start up shogi-server in foreground
[shogi-server/shogi-server.git]
/
sample
/
test_time.rb
1
require 'time'
2
3
class Time
4
5
@@offset = Time.now - Time.mktime(Time.now.year, Time.now.month, Time.now.day+1) + 10
6
class << self
7
alias :orig_now :now
8
def now
9
return orig_now - @@offset
10
end
11
end
12
13
# def initialize
14
# super
15
#=begin
16
# if @@offset == 0
17
# current = Time.orig_now
18
# @@offset = current - Time.mk_time(current.year, current.month, current.day)
19
# end
20
#=end
21
# end
22
23
end
24
25
if $0 == __FILE__
26
puts Time.now
27
sleep 1
28
puts Time.now
29
end