• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

In Windows, how to measure any java program execution time from other monitoring java program ?

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am trying to write a java program which can find out execution time of any other java program, on window platform.

Is it possible to do this ?

I am able to read all java process, using below snippet:-



Thanks in advance,
Rahul
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How would you identify the "unknown" program from the list as a human? Identifying that is the first step before being able to code anything.
 
Rahul Chhabra
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hhmm.. To make it more clear and to the point-

How to write java program say 'A', that can measure execution time of any other java program say 'B' or 'C'.
'A' can be ever-running monitor program, that's waiting for any other java program to execute and calculate its execution time.

I am trying to fetch this information from tasklist command in windows.

Any hints ??
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What kind of hints are you looking for? Or to put it another way, what part of that can't you do?
 
Rahul Chhabra
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hint Required-

1. how to get information from tasklist command, that any other java process (say PID 2130) has started at this particular timestamp and once its finished, its finishing timestamp.

If not possible from tasklist command, any other way to get this information.

I dont want to put in java code- System.currentTimeMillis() way of calculating execution time.

Thanks.
 
Paul Clapham
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But the tasklist.exe program only displays tasks that are running at the moment you call that program, isn't that right? In other words it won't tell you when a particular task starts, nor will it tell you when it finishes. And since those are the two pieces of information you want, and tasklist.exe doesn't provide either of them, I really don't think it's the best choice. Wouldn't you agree?
 
Rahul Chhabra
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Agree and exactly, and thats where I am stuck.

What other alternatives I have ?
I need to compute much more information like memory space etc, starting with timestamp. So I thought tasklist.exe can be sufficient, but surely, it does not seem so.

Thanks.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic