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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • neoedmund

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


    /**
    * 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.
    *
    * <pSee the description of the class <code>Date</codefor
    * 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 currentTimeMill is();

    python's time.clock() time.time() return a float,
    i think it's not as handy as java's currentTimeMill is()
    any good solution? thanks.

  • skip@pobox.com

    #2
    Re: what is java's System.currentT imeMillis() in python


    neoedmund public static native long currentTimeMill is();

    neoedmundpython 's time.clock() time.time() return a float, i think
    neoedmundit's not as handy as java's currentTimeMill is() any good
    neoedmundsoluti on?

    How about

    int(time.clock( ) * 1000)

    or

    int(time.time() * 1000)

    ?

    Skip

    Comment

    Working...