本文整理汇总了Python中Timer.Timer.start_interval方法的典型用法代码示例。如果您正苦于以下问题:Python Timer.start_interval方法的具体用法?Python Timer.start_interval怎么用?Python Timer.start_interval使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Timer.Timer
的用法示例。
在下文中一共展示了Timer.start_interval方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Timer
# 需要导入模块: from Timer import Timer [as 别名]
# 或者: from Timer.Timer import start_interval [as 别名]
import pygame
from PIL.Image import open
from OpenGL.GL import *
from Timer import Timer
filepath = "../src/lena.jpg"
timer = Timer()
screen = pygame.display.set_mode((1280, 720), pygame.OPENGL | pygame.DOUBLEBUF)
pygame.init()
# 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
示例2: Timer
# 需要导入模块: from Timer import Timer [as 别名]
# 或者: from Timer.Timer import start_interval [as 别名]
#Created on 27 june 2014
#@author bastien.laby
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):