Python Forum
How to assess elapsed time to execute a .exe file or opening a desktop application?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to assess elapsed time to execute a .exe file or opening a desktop application?
#1
I used following code but not got any success. It is not providing the elapsed time to open the pdf file. Please help with suitable code. I am using python 3.7

start = timeit()
subprocess.Popen(r'C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRD32.exe')
end = timeit()
elapsed_time = end - start
Reply
#2
It might be worth having a look at https://stackoverflow.com/questions/1557...-execution which covered a related question.
Reply
#3
What if you pass the file as argument
subprocess.Popen([acr_rdr, pdf_file])
where acr_rdr is path to exe, pdf_file is path to file you open?
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  pass arguments from bat file to pyhon script from application absolut 2 1,100 Jan-13-2025, 11:05 AM
Last Post: DeaD_EyE
  Reading a file name fron a folder on my desktop Fiona 4 2,120 Aug-23-2023, 11:11 AM
Last Post: Axel_Erfurt
  Failed to execute child process (No such file or directory) uriel 1 2,398 Sep-15-2022, 03:48 PM
Last Post: Gribouillis
  How To Set Up And Execute A Python File knight2000 4 4,179 May-31-2022, 10:02 AM
Last Post: Larz60+
  execute commands inside a running application mr_byte31 3 2,190 Apr-12-2022, 08:50 AM
Last Post: Larz60+
  Facing Problem while opening a file through command prompt vlearner 4 3,184 Jan-30-2022, 08:10 AM
Last Post: snippsat
  How to send data from a python application to an external application aditya_rajiv 1 3,015 Jul-26-2021, 06:00 AM
Last Post: ndc85430
  Check last time file was accessed Pavel_47 4 3,997 Jun-01-2021, 05:47 PM
Last Post: Yoriz
  find the header location in a .bin file without reading the whole file at a time SANJIB 0 2,890 Mar-05-2021, 04:08 PM
Last Post: SANJIB
  Subprocesses not opening File Select Dialog teut 2 3,262 Feb-22-2021, 08:07 PM
Last Post: teut

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020