Created
June 11, 2019 08:15
-
-
Save vangheem/c35cabc5da9ae1328ed5feee1894bbd2 to your computer and use it in GitHub Desktop.
Simple CPU bound flask app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ./bin/uwsgi --http 127.0.0.1:5000 --module cpu_bound_flask:app | |
from flask import Flask | |
import time | |
DURATION = 0.5 | |
app = Flask(__name__) | |
@app.route('/') | |
def cpu_bound(): | |
start = time.time() | |
while True: | |
9 * 9 | |
if (time.time() - start) > DURATION: | |
break | |
return 'done' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment