本文整理汇总了Python中psychopy.iohub.Computer.currentTime方法的典型用法代码示例。如果您正苦于以下问题:Python Computer.currentTime方法的具体用法?Python Computer.currentTime怎么用?Python Computer.currentTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类psychopy.iohub.Computer
的用法示例。
在下文中一共展示了Computer.currentTime方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: checkForEvents
# 需要导入模块: from psychopy.iohub import Computer [as 别名]
# 或者: from psychopy.iohub.Computer import currentTime [as 别名]
def checkForEvents(self):
# get the time we request events from the ioHub
stime=Computer.currentTime()
r = self.hub.getEvents()
if r and len(r) > 0:
# so there were events returned in the request, so include this getEvent request in the tally
etime=Computer.currentTime()
dur=etime-stime
return r, dur*1000.0
return None,None
示例2: test_getTime
# 需要导入模块: from psychopy.iohub import Computer [as 别名]
# 或者: from psychopy.iohub.Computer import currentTime [as 别名]
def test_getTime(self):
ta = Computer.currentSec()
tb = Computer.currentTime()
tc = Computer.getTime()
tp = getTime()
assert ta < tb < tc < tp
assert tp - ta < 0.002
示例3: test_getTime
# 需要导入模块: from psychopy.iohub import Computer [as 别名]
# 或者: from psychopy.iohub.Computer import currentTime [as 别名]
def test_getTime(self):
ta = Computer.currentSec()
tb = Computer.currentTime()
tc = Computer.getTime()
tp = getTime()
assert ta <= tb <= tc <= tp
assert tp - ta < 0.002
ta = getTime()
tb = self.io.getTime()
tc = self.io.getTime()
tp = getTime()
assert ta <= tb <= tc <= tp
assert tp - ta < 0.01