Java Nano Second Convert parseNanoseconds(String s)

Here you can find the source of parseNanoseconds(String s)

Description

parse Nanoseconds

License

Open Source License

Declaration

static int parseNanoseconds(String s) 

Method Source Code

//package com.java2s;
// (c) 2012 B Smith-Mannschott -- Distributed under the Eclipse Public License

public class Main {
    static int parseNanoseconds(String s) {
        if (s == null) {
            return 0;
        } else if (s.length() < 9) {
            return Integer.parseInt(s + "000000000".substring(s.length()));
        } else {//www. j  a va 2s .c  o m
            return Integer.parseInt(s);
        }
    }
}

Related

  1. nanoToSec(Long n)
  2. nanoToSeconds(double nano)
  3. nanoToSecs(final long nanoTime)
  4. nanoToStr(long tsp)
  5. nowInNanoseconds()
  6. stringToNanoseconds(String time)