Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High CPU usage as soon as observer starts #75

Open
Unixsystem13 opened this issue Jun 4, 2019 · 1 comment
Open

High CPU usage as soon as observer starts #75

Unixsystem13 opened this issue Jun 4, 2019 · 1 comment

Comments

@Unixsystem13
Copy link

Unixsystem13 commented Jun 4, 2019

import time
from twitchobserver import Observer

observer = Observer('name', 'oauth:1234etc')
observer.start()


while True:
    time.sleep(1)
    print("sleep")

This script is giving me 10-15% CPU on a high end, modern CPU. If I remove the line oberver.start(), it uses <0.1%. It's enough that if I try to run the script while streaming a demanding game, the game's framerate drops into unplayability. Is this somehow expected behavior or am I missing something obvious?

@PythooonUser
Copy link
Collaborator

Calling observer.start() is needed when you want to use the bot, only then it starts receiving messages from the chat.

Have you tried to run any of the examples either in the readme or in the cookbook? The Echo Bot is a good example to start with.

Is this giving you a high CPU usage as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants