System Time Functions, system functions

Source: Internet
Author: User

System Time Functions, system functions

1. public static long currentThreadTimeMillis () returns the number of milliseconds that run in the current thread.

2. public static long elapsedRealtime () returns the number of milliseconds since the system was started, including the sleep time.

3. public static long elapsedRealtimeNanos () returns the number of nanoseconds since the system was started, including the sleep time.

4. public static boolean setCurrentTimeMillis (long millis) sets the current "wall" time and requires that the calling process have permission. Whether the request is successful.

5. public static void sleep (long MS) waits for the given time. Similar to Thread. sleep (millis), but it does not throw an InterruptedException exception. The event is postponed to the next interrupted operation. This method is not returned until the specified time expires.

6. public static long uptimeMillis () returns the number of milliseconds since the system was started, excluding the sleep time. That is to say, the statistical system starts to the current non-sleep period.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.