package com.chenyang.nse.bussiness.tools.number;

import java.util.Random;

public class IntegerTool {
   public static int randomInt() {
      Random rand = new Random();
      int i = rand.nextInt();
      i = rand.nextInt(100);
      return i;
   }

   public static int randomInt(int min, int max) {
      Random rand = new Random();
      int randNum = rand.nextInt(max - min + 1) + min;
      return randNum;
   }

   public static void main(String[] args) {
      long s = System.currentTimeMillis();

      for(int i = 0; i < 10000; ++i) {
         System.out.println(randomInt(0, 100000000));
      }

      long e = System.currentTimeMillis();
      System.out.println(e - s);
   }

   public static boolean isNumeric(String str) {
      return str != null && str.matches("-?\\d+(\\.\\d+)?");
   }
}
