本文整理汇总了Python中Timer.Timer.stop_interval方法的典型用法代码示例。如果您正苦于以下问题:Python Timer.stop_interval方法的具体用法?Python Timer.stop_interval怎么用?Python Timer.stop_interval使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Timer.Timer
的用法示例。
在下文中一共展示了Timer.stop_interval方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: range
# 需要导入模块: from Timer import Timer [as 别名]
# 或者: from Timer.Timer import stop_interval [as 别名]
# Load images with Pygame
timer.start_interval("Load texture with Pygame")
for i in range(500):
data = pygame.image.load(os.path.join("", filepath))
image = pygame.image.tostring(data, 'RGBA', 1)
width, height = data.get_rect().size
tex = glGenTextures(1)
glBindTexture(GL_TEXTURE_2D, tex)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA,
GL_UNSIGNED_BYTE, image)
glBindTexture(GL_TEXTURE_2D, 0)
timer.stop_interval("Load texture with Pygame")
# Load images with PIL
timer.start_interval("Load texture with PIL")
for i in range(500):
im = open(filepath)
ix, iy, image = 0, 0, None
try:
ix, iy, image = im.size[0], im.size[1], im.tostring("raw", "RGBA", 0, -1)
except SystemError:
ix, iy, image = im.size[0], im.size[1], im.tostring("raw", "RGBX", 0, -1)
tex = glGenTextures(1)
glBindTexture(GL_TEXTURE_2D, tex)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)
示例2: Timer
# 需要导入模块: from Timer import Timer [as 别名]
# 或者: from Timer.Timer import stop_interval [as 别名]
from Timer import Timer
timer = Timer()
ss = "Teamto Hello"
#
# Test if a string contains a word
#
# IN statement
timer.start_interval("in statement")
for i in range(10000000):
if "Teamto" in ss:
continue
timer.stop_interval("in statement")
# __contains__ method
timer.start_interval("contains method")
for i in range(10000000):
if ss.__contains__("Teamto"):
continue
timer.stop_interval("contains method")
# startswith method
timer.start_interval("startswith method")
for i in range(10000000):
if ss.startswith("Teamto"):
continue
timer.stop_interval("startswith method")