Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

time.perf_counter

# Python program to show time by perf_counter()
from time import perf_counter
 
# integer input from user, 2 input in single line
n, m = map(int, input().split())
 
# Start the stopwatch / counter
t1_start = perf_counter()
 
for i in range(n):
    t = int(input()) # user gave input n times
    if t % m == 0:
        print(t)
 
# Stop the stopwatch / counter
t1_stop = perf_counter()
 
print("Elapsed time:", t1_stop, t1_start)
 
 
print("Elapsed time during the whole program in seconds:",
                                        t1_stop-t1_start)
Comment

PREVIOUS NEXT
Code Example
Python :: print str and float python 
Python :: how to input a string in streamlit 
Python :: ipython.display install 
Python :: delete the content from the entry form in tkinter python 
Python :: pandas dataframe from tsv 
Python :: django models using Value 
Python :: Row wise mean pandas 
Python :: remove duplicates python 
Python :: python selenium web scraping example 
Python :: django creating calculated fields in model 
Python :: datediff in seconds in pandas 
Python :: How to convert simple string in to camel case in python 
Python :: python how to get the screen size 
Python :: pd count how many item occurs in another column 
Python :: unique id python 
Python :: AttributeError: __enter__ python 
Python :: serial clear buffer python 
Python :: remove 1st column pandas 
Python :: how to remove some lines border from plt plot 
Python :: how to import date python 
Python :: with open python 
Python :: display 2d numpy array as image 
Python :: pyspark when otherwise multiple conditions 
Python :: python conditional operator one line 
Python :: python remove empty list 
Python :: swapping of two numbers in python 
Python :: python convert timestamp to datetime 
Python :: python convert exponential to int 
Python :: No package python37 available. 
Python :: Get game status discord.py 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =