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


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

Re: Get real, user and system time

From Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Get real, user and system time
Date 2020-07-21 01:40 +0200
Organization A noiseless patient Spider
Message-ID <rf5a0m$q3a$1@dont-email.me> (permalink)
References <87o8oc99wk.fsf@munus.decebal.nl>

Show all headers | View raw


On 2020-07-18 16:26, 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?

I don't know, but I doubt it very much:

1. Those are POSIX features, right? They don't have a ready equivalent
in other systems, right? Then Java, which is supposed to be
platform-independent, won't have them built-in.

2. System and user time are process-level notions, aren't they? I don't
know the C world that well, but could you get them at the method-level
if you limited the scope to native code on a POSIX-compliant system? If
not, you can be certain they won't be available in Java.

3. How would even this work? What if the thread executing your method is
suspended and another takes over for a few loops? What about parallel
execution? How would you sort those out in terms of method-level user
and system time?

I don't see it. I don't even get it.

-- 
DF.

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