Java Milliseconds microsToMillis(long micros)

Here you can find the source of microsToMillis(long micros)

Description

Convert microseconds to milliseconds, ensuring that any microsecond value greater than zero converts to at least one millisecond to avoid a zero millisecond result since Object.wait(0) waits forever.

License

Open Source License

Declaration

public static long microsToMillis(long micros) 

Method Source Code

//package com.java2s;
/*-//from w ww. j a  v a 2s . c o m
 * See the file LICENSE for redistribution information.
 *
 * Copyright (c) 2002,2007 Oracle.  All rights reserved.
 *
 * $Id: PropUtil.java,v 1.22.2.1 2007/02/01 14:49:54 cwl Exp $
 */

public class Main {
    /**
     * Convert microseconds to milliseconds, ensuring that any microsecond
     * value greater than zero converts to at least one millisecond to avoid a
     * zero millisecond result since Object.wait(0) waits forever.
     */
    public static long microsToMillis(long micros) {
        return (micros + 999) / 1000;
    }
}

Related

  1. humanDateToMillisecondsWithoutException(String date)
  2. isSameSecondOfMillis(final long ms1, final long ms2)
  3. longToDate(long millis)
  4. marsTimeFromElapsedMillis(long elapsedMillis, int[] marsTime)
  5. megaCyclesToMilliseconds(long megaCycles)
  6. microsToMillis(long sec, long usec)
  7. milliDate(String date)
  8. millisBetween(Date firstDate, Date lastDate)
  9. millisecond(final Date date)