Renecto commited on
Commit
ae8691e
1 Parent(s): 01c4f36

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -1,9 +1,15 @@
1
  import gradio as gr
2
  import time
 
 
 
 
3
 
4
  def greet(name):
5
- time.sleep(10)
6
- return "limit 5 " + name + "!!"
 
 
7
 
8
  demo = gr.Interface(fn=greet, inputs="text", outputs="text", concurrency_limit=5)
9
  demo.launch()
 
1
  import gradio as gr
2
  import time
3
+ from datetime import datetime
4
+ import pytz
5
+ import psutil
6
+
7
 
8
  def greet(name):
9
+ start = datetime.now(pytz.timezone('Asia/Tokyo')).strftime("%Y-%m-%d %H:%M:%S")
10
+ time.sleep(3)
11
+ end = datetime.now(pytz.timezone('Asia/Tokyo')).strftime("%Y-%m-%d %H:%M:%S")
12
+ return f"[{name}] {start} ~ {end}"
13
 
14
  demo = gr.Interface(fn=greet, inputs="text", outputs="text", concurrency_limit=5)
15
  demo.launch()