1
# Permission is hereby granted, free of charge, to any person
2
# obtaining a copy of this software and associated documentation files
3
# (the "Software"), to deal in the Software without restriction,
4
# including without limitation the rights to use, copy, modify, merge,
5
# publish, distribute, sublicense, and/or sell copies of the Software,
6
# and to permit persons to whom the Software is furnished to do so,
7
# subject to the following conditions:
9
# The above copyright notice and this permission notice shall be
10
# included in all copies or substantial portions of the Software.
12
# The Software is provided "AS IS", without warranty of any kind,
13
# express or implied, including but not limited to the warranties of
14
# merchantability, fitness for a particular purpose and
15
# noninfringement. In no event shall the authors or copyright holders
16
# be liable for any claim, damages or other liability, whether in an
17
# action of contract, tort or otherwise, arising from, out of or in
18
# connection with the Software or the use or other dealings in the
21
# Copyright (C) 2002 John Hoffman
22
# 2006-2010 Participatory Culture Foundation
24
from time import time, clock
35
self.lock = threading.Lock()
40
t = time() + self.offset
41
if t < self.time or t > self.time + _MAXFORWARD:
44
# print "self.time: %s" % self.time
45
# print "self.offset: %s" % self.offset
47
self.offset += self.time - t
54
if sys.platform != 'win32':
55
_RTIME = RelativeTime()
57
return _RTIME.get_time()