Skip to content

Commit 68b9e70

Browse files
authored
Update time_to_load_website.py
1 parent 2748ad6 commit 68b9e70

1 file changed

Lines changed: 0 additions & 7 deletions

File tree

‎projects/Time to load Website/time_to_load_website.py‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,15 @@ def get_load_time(url):
1717
open_this_url = urlopen(url) # Open the url as entered by the user
1818
else:
1919
open_this_url = urlopen("https://" + url) # Adding https to the url
20-
2120
start_time = time.time() # Time stamp before the reading of url starts
22-
2321
open_this_url.read() # Reading the user defined url
24-
2522
end_time = time.time() # Time stamp after the reading of the url
26-
2723
open_this_url.close() # Closing the instance of the urlopen object
28-
2924
time_to_load = end_time - start_time
3025

3126
return time_to_load
3227

3328

3429
if __name__ == '__main__':
35-
3630
url = input("Enter the url whose loading time you want to check: ")
37-
3831
print(f"\nThe time taken to load {url} is {get_load_time(url):.2} seconds.")

0 commit comments

Comments
 (0)