mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-17 07:33:00 +00:00
Optimize stock news display performance: - Cache text image to reduce rendering overhead - Improve frame creation and update logic - Optimize text wrapping for smoother scrolling - Remove unnecessary display clears
This commit is contained in:
@@ -38,14 +38,9 @@ def main():
|
||||
|
||||
print("Testing news display. Press Ctrl+C to exit.")
|
||||
|
||||
# Run the news display in a loop with proper timing
|
||||
last_update = time.time()
|
||||
# Run the news display in a loop
|
||||
while True:
|
||||
current_time = time.time()
|
||||
# Ensure we're not updating too frequently
|
||||
if current_time - last_update >= 0.001: # 1ms minimum between updates
|
||||
news_manager.display_news()
|
||||
last_update = current_time
|
||||
news_manager.display_news()
|
||||
|
||||
except KeyboardInterrupt:
|
||||
print("\nTest interrupted by user")
|
||||
|
||||
Reference in New Issue
Block a user