Exemple #1
0
			circle_count = 0

# First result is unreliable
result.pop(0)
print('Average rate: ' + str(reduce(lambda x, y: x + y, result) / len(result)))
'''

print('Testing box draw rate')
result = []
circle_count = 0
last_sec = time.localtime().tm_sec
total_count = 0
while len(result) < 10:
	for color in colors:
		#tft.fg_color(color)
		tft.draw_box(randint(0,tft.Screen.width),randint(0,tft.Screen.height),randint(0,tft.Screen.width),randint(0,tft.Screen.height),color)
		circle_count += 1
		total_count += 1
		if time.localtime().tm_sec !=last_sec:
			last_sec = time.localtime().tm_sec
			print('Drawn ' + str(circle_count))
			result.append(circle_count)
			circle_count = 0

# First result is unreliable
result.pop(0)
print('Average rate: ' + str(reduce(lambda x, y: x + y, result) / len(result)))


print('Testing filled box draw rate')
result = []