Skip to content

Commit

Permalink
add import timer
Browse files Browse the repository at this point in the history
  • Loading branch information
vvd170501 committed Jan 16, 2021
1 parent 8f8e36c commit 77f5201
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
5 changes: 5 additions & 0 deletions kks/cmd/auth.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
from time import time

import click
t1 = time()
import requests
t2 = time()
print('import requests', t2 - t1)

from kks.ejudge import ejudge_auth, AuthData, get_contest_id
from kks.util.common import store_session, save_auth_data, save_links
Expand Down
13 changes: 12 additions & 1 deletion kks/ejudge.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,23 @@
from itertools import groupby
from urllib.parse import quote as urlquote

from time import time

import click
t1 = time()
import requests
t2 = time()
print('import requests', t2 - t1)

t1 = time()
from bs4 import BeautifulSoup
from bs4.element import NavigableString

t2 = time()
print('import bs', t2 - t1)
t1 = time()
from kks.util.h2t import HTML2Text
t2 = time()
print('import h2t', t2 - t1)

CONTEST_ID_BY_GROUP = {
int('19' + str(i)): 130 + i
Expand Down
5 changes: 5 additions & 0 deletions kks/ejudge_submit.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
from time import time

import click
t1 = time()
from bs4 import BeautifulSoup
t2 = time()
print('import bs', t2 - t1)

from kks.ejudge import Status, ejudge_summary
from kks.util.common import prompt_choice
Expand Down
5 changes: 5 additions & 0 deletions kks/util/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
import pickle
from pathlib import Path

from time import time

import click
t1 = time()
import requests
t2 = time()
print("import requests", t2 - t1)

from kks.ejudge import AuthData, ejudge_auth, check_session

Expand Down

0 comments on commit 77f5201

Please sign in to comment.