Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #39571

Re: Get real, user and system time

From Martin Gregorie <martin@mydomain.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Get real, user and system time
Date 2020-07-18 20:59 +0000
Organization A noiseless patient Spider
Message-ID <revnrj$115$1@dont-email.me> (permalink)
References <87o8oc99wk.fsf@munus.decebal.nl>

Show all headers | View raw


On Sat, 18 Jul 2020 16:26:35 +0200, Cecil Westerhof wrote:

> In Linux we have the time command to get the real, user and system time
> that a command takes.
> I know how to get the real time a method takes, but is there a way to
> get the user and system time a method takes also?
>
The only way I can think of, offhand would be the Stopwatch class, which 
appeared here some time ago. I won't include it as the (reasonably well-
commented) copy I have is 118 lines. It has start(), stop() methods, so 
start/stop should be called to time a process and toString() to display 
the elapsed time in seconds. Its resolution is to the nearest millisecond.

I've not included it because my copy is 118 lines, tolerably commented.
I can e-mail you a copy if it looks useful.


-- 
Martin    | martin at
Gregorie  | gregorie dot org

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Get real, user and system time Cecil Westerhof <Cecil@decebal.nl> - 2020-07-18 16:26 +0200
  Re: Get real, user and system time Martin Gregorie <martin@mydomain.invalid> - 2020-07-18 20:59 +0000
    Re: Get real, user and system time Luuk <luuk@invalid.lan> - 2020-07-20 08:06 +0200
      Re: Get real, user and system time Martin Gregorie <martin@mydomain.invalid> - 2020-07-20 08:55 +0000
  Re: Get real, user and system time Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2020-07-21 01:40 +0200
    Re: Get real, user and system time Martin Gregorie <martin@mydomain.invalid> - 2020-07-21 11:52 +0000
      Threads [Was: Get real, user and system time] Eric Sosman <esosman@comcast-dot-net.invalid> - 2020-07-21 08:42 -0400
        Re: Threads [Was: Get real, user and system time] Martin Gregorie <martin@mydomain.invalid> - 2020-07-21 16:55 +0000
          Re: Threads [Was: Get real, user and system time] Eric Sosman <esosman@comcast-dot-net.invalid> - 2020-07-21 15:46 -0400
            Re: Threads [Was: Get real, user and system time] Martin Gregorie <martin@mydomain.invalid> - 2020-07-21 20:16 +0000
          Re: Threads [Was: Get real, user and system time] Martin Gregorie <martin@mydomain.invalid> - 2020-07-21 23:14 +0000
      Re: Get real, user and system time Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2020-07-22 00:23 +0200

csiph-web