aspose file tools*
The moose likes Performance and the fly likes In Windows, how to measure any java program execution time from other monitoring java program ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Performance
Bookmark "In Windows, how to measure any java program execution time from other monitoring java program ?" Watch "In Windows, how to measure any java program execution time from other monitoring java program ?" New topic
Author

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

Vicky Arora
Greenhorn

Joined: Jul 13, 2009
Posts: 10
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

SCJP 6-95 %, SCWCD Preparing.

If you want to be best, then just, beat the Best !!!
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30555
    
152

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Vicky Arora
Greenhorn

Joined: Jul 13, 2009
Posts: 10
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 ??
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

What kind of hints are you looking for? Or to put it another way, what part of that can't you do?
Vicky Arora
Greenhorn

Joined: Jul 13, 2009
Posts: 10
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
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

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?
Vicky Arora
Greenhorn

Joined: Jul 13, 2009
Posts: 10
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: In Windows, how to measure any java program execution time from other monitoring java program ?