Avatar of deepakabc
deepakabcFlag for Australia asked on

how calculate esitmated time of a process

how to calculate esitmated time for a python program. .. how can i do that like cpu speed or something else i don't have any idea please help me out
Python

Avatar of undefined
Last Comment
pepr

8/22/2022 - Mon
praveen_mundlapati

If you are using the linux operating system. use "time" command.

look for manual page of time for more information and format of the outpuy
ASKER
deepakabc

using windows and internet explorer ...

how do i do in windows..  can give me rough program or any example on internet or something like that
praveen_mundlapati

Get the time at the start and end of the program, and print the difference.

tf1 = time.strftime("%b %d %Y %H:%M:%S")
tt1 = time.strptime(tf1, "%b %d %Y %H:%M:%S" )
t1 = time.mktime(tt1)
...... you program code

tf2 = time.strftime("%b %d %Y %H:%M:%S")
tt2 = time.strptime(tf2, "%b %d %Y %H:%M:%S" )
t2 = time.mktime(tt2)

t2 -t1 // no. of seconds elapsed.

Your help has saved me hundreds of hours of internet surfing.
fblack61
ASKER CERTIFIED SOLUTION
pepr

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question