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

N

neoedmund

/**
* 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.
 
S

skip

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top