what is java's System.currentTimeMillis() in python

Discussion in 'Python' started by neoedmund, Sep 8, 2006.

  1. neoedmund

    neoedmund Guest

    /**
    * Returns the current time in milliseconds. Note that
    * while the unit of time of the return value is a millisecond,
    * the granularity of the value depends on the underlying
    * operating system and may be larger. For example, many
    * operating systems measure time in units of tens of
    * milliseconds.
    *
    * <p> See the description of the class <code>Date</code> for
    * a discussion of slight discrepancies that may arise between
    * "computer time" and coordinated universal time (UTC).
    *
    * @return the difference, measured in milliseconds, between
    * the current time and midnight, January 1, 1970 UTC.
    * @see java.util.Date
    */
    public static native long currentTimeMillis();

    python's time.clock() time.time() return a float,
    i think it's not as handy as java's currentTimeMillis()
    any good solution? thanks.
     
    neoedmund, Sep 8, 2006
    #1
    1. Advertising

  2. neoedmund

    Guest

    neoedmund> public static native long currentTimeMillis();

    neoedmund> python's time.clock() time.time() return a float, i think
    neoedmund> it's not as handy as java's currentTimeMillis() any good
    neoedmund> solution?

    How about

    int(time.clock() * 1000)

    or

    int(time.time() * 1000)

    ?

    Skip
     
    , Sep 8, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nelson
    Replies:
    17
    Views:
    9,207
    Darryl L. Pierce
    May 20, 2004
  2. Jerry

    System.currentTimeMillis()

    Jerry, Aug 3, 2005, in forum: Java
    Replies:
    18
    Views:
    46,516
    Thomas G. Marshall
    Aug 6, 2005
  3. Alex
    Replies:
    15
    Views:
    2,743
  4. Roedy Green
    Replies:
    8
    Views:
    1,212
    Daniel Dyer
    Mar 9, 2006
  5. tak
    Replies:
    6
    Views:
    2,393
    James Kanze
    Sep 28, 2007
Loading...

Share This Page