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

Path csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From Martin Gregorie <martin@mydomain.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Get real, user and system time
Date Sat, 18 Jul 2020 20:59:31 -0000 (UTC)
Organization A noiseless patient Spider
Lines 21
Message-ID <revnrj$115$1@dont-email.me> (permalink)
References <87o8oc99wk.fsf@munus.decebal.nl>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
Injection-Date Sat, 18 Jul 2020 20:59:31 -0000 (UTC)
Injection-Info reader02.eternal-september.org; posting-host="b04eacddc4358a12a58cbc27c30bd72a"; logging-data="1061"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1++DmZUjGWhO9/0G+dXP08ch8cZBQ5ekRM="
User-Agent Pan/0.146 (Hic habitat felicitas; 8107378 git@gitlab.gnome.org:GNOME/pan.git)
Cancel-Lock sha1:cC3czv1NCWaGrLwpbEFCUHY2B6I=
Xref csiph.com comp.lang.java.programmer:39571

Show key headers only | 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