-
-
Save deepanshu-nickelfox/a429ca01242dd5f0de1a76f6191642be to your computer and use it in GitHub Desktop.
basic function to test time counting.
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
import time | |
def send_push(user_id): | |
""" | |
demo function to send notification | |
""" | |
print("Start: "+str(user_id)) | |
time.sleep(1) # sleep 1 second when sending notification. | |
print("Complete: "+str(user_id)) | |
def main(): | |
user_count = int(input("Enter total user: ")) | |
t1 = time.time() # starting time | |
# Start sending notification to eatch user | |
for i in range(user_count): | |
send_push(i) | |
# End time. | |
total_time = time.time() - t1 | |
print("Total time: " + str(total_time)) | |
if __name__=='__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment