Is there any possibility to count the working time of a processes in java?  for example in a pseudo code  for(some Object:all Objects){ startProcess1(); .... startProcessn();} if(startProcess1 is finished){ getTimeOfProcessOne()}   Thanks
27793
How do I get a method's execution time?   Is there a Timer utility class for things like timing how long a task takes, etc?     Most of the searches on Google return results for timers that schedule threads and tasks, which is not what I want.
15211
Is there any way I can see at what time the commands were executed from the bash history? We can see the order but is there any way I can get the time also?  Bottom-Line: Execution time in the Bash history
3686
I need to check CPU and memory usage for the server in java, anyone know how it could be done?
15104
sum = 0;  for (i = 0; i &lt; n; i++)    for (j = 1; j &lt; n^3; j = 3*j)                  sum++;   what is the time complexity (in $\Theta$-notation) in terms of $n$?  so far, this is what i've done: The running time is $\Theta(N^4)$  Because the for loop’s condition is depend on $n$ and is incremented by $1$, and  then inside running time is $\mathcal{O}(1)$. i feel i'm wrong here. any help would be appreciated.
113449
As documented in the blog post , on x86 systems, Java's System.nanoTime() returns the time value using a  specific counter. Now consider the following case I use to measure time of a call:  long time1= System.nanoTime(); foo(); long time2 = System.nanoTime(); long timeSpent = time2-time1;   Now in a multi-core system, it could be that after measuring time1, the thread is scheduled to a different processor whose counter is less than that of the previous CPU. Thus we could get a value in time2 which is less than time1. Thus we would get a negative value in timeSpent.  Considering this case, isn't it that System.nanotime is pretty much useless for now?  I know that changing the system time doesn't affect nanotime. That is not the problem I describe above. The problem is that each CPU will keep a different counter since it was turned on. This counter can be lower on the second CPU compared to the first CPU. Since the thread can be scheduled by the OS to the second CPU after getting time1, the value of timeSpent may be incorrect and even negative.
5607
I'd like to format a duration in seconds using a pattern like H:MM:SS. The current utilities in java are designed to format a time but not a duration.
82826
Is it possible to have your bash history save the total execution time of every command you run?  i.e. as if every command were prefaced with 'time' and the result was stored in the history along with the command?  clarification: I already know that you can add a timestamp of when the command was started - but I would like to know the total execution time, not just when it was started.
107129
I'm trying to get a list of processes currently owned by the current user (Environment.UserName). Unfortunately, the Process class doesn't have any way of getting the UserName of the user owning a process.  How do you get the UserName of the user which is the owner of a process using the Process class so I can compare it to Environment.UserName?   If your solution requires a pinvoke, please provide a code example.
5727
I want to do some benchmarking of a C# process, but I don't want to use time as my vector - I want to count the number of IL instructions that get executed in a particular method call. Is this possible?  Edit I don't mean static analysis of a method body - I'm referring to the actual number of instructions that are executed - so if, for example, the method body includes a loop, the count would be increased by however many instructions make up the loop * the number of times the loop is iterated.
83578
i need to count total number of records in an sObject which can have around one million records. Will the code below work ? If no, how can this be done ? I dont need to use this in a vf page.   I will be using this COUNT() SOQL Query in a batch class which is scheduled to run at specific time.  AggregateResult results = database.query('SELECT COUNT(id) result FROM someSObject');     System.debug('No of ids are: '+results.get('result'));
75925
When I login, I notice many process quickly start and terminate in task manager. But it happens very fast and I cannot save details about them (like process name, command line, CPU usage,..)  How can I collect stats about them so I can view them later
105773
I would like to display the completion time of a script.   What I currently do is -  #!/bin/bash date  ## echo the date at start # the script contents date  ## echo the date at end   This just show's the time of start and end of the script. Would it be possible to display a fine grained output like processor time/ io time , etc?
114417
Does anyone know of a program or way to log all network activity to a specific program on one's computer (program and/or service)?  I know I can see this "live" in Resource Monitor, but I'm wondering if anyone knows of a program or way to track and log all network activity to/from a specific process and/or service.  I'm finding a lot of "live"-type monitors, like Windows Resource Monitor, but nothing that can log.
7166
How to limit process to one cpu core ?  Something similar to ulimit or cpulimit would be nice. (Just to ensure: I do NOT want to limit percentage usage or time of execution. I want to force app (with all it's children, processes (threads)) to use one cpu core (or 'n' cpu cores)).
92098
When a java based application starts to misbehave on a windows machine, you want to be able to kill the process in the task manager if you can't quit the application normally. Most of the time, there's more than one java based application running on my machine. Is there a better way than just randomly killing java.exe processes in hope that you'll hit the correct application eventually?  EDIT: Thank you to all the people who pointed me to Sysinternal's Process Explorer - Exactly what I'm looking for!
53518
I'm looking for a program/utility to monitor a process running in Windows 7 (actually it's a Java process ran from .jnlp). and that can send an e-mail alert or trigger any kind of script so I can be aware that it has crashed ?   From what i've seen there's nothing like that.  Any ideas ?
15189
time is a brilliant command if you want to figure out how much CPU time a given command takes.  I am looking for something similar that can list the files being accessed by a program and its children. Either in real time or as a report afterwards.  Currently I use:  #!/bin/bash  strace -ff -e trace=file "$@" 2&gt;&amp;1 | perl -ne 's/^[^"]+"(([^\\"]|\\[\\"nt])*)".*/$1/ &amp;&amp; print'   but its fails if the command to run involves sudo. It is not very intelligent (it would be nice if it could only list files existing or that had permission problems or group them into files that are read and files that are written). Also strace is slow, so it would be good with a faster choice.