Skip to content

Instantly share code, notes, and snippets.

@deepanshu-nickelfox
Forked from harunurkst/pushme.py
Created November 10, 2020 04:47
Show Gist options
  • Save deepanshu-nickelfox/a429ca01242dd5f0de1a76f6191642be to your computer and use it in GitHub Desktop.
Save deepanshu-nickelfox/a429ca01242dd5f0de1a76f6191642be to your computer and use it in GitHub Desktop.
basic function to test time counting.
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