title: calculate elapsed time(second time mark - first time mark)
body: <p>I have service(Service has a Broadcast receiver, that listens for <code>ACTION_BATTERY_CHANGED</code>), that I want to calculate time passed between two time marks, this what I have:</p>
  
  <pre><code>public void onReceive(Context context, Intent intent){
                      int level = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);
                  long time;
                  long startTime=0;
  
                      if(OldLevel==0){
                      OldLevel=level;
                      startTime = System.nanoTime();
  
                      }
                      else{
  
                          time=System.nanoTime()-startTime;
                          startTime=System.nanoTime();  //edited
  
  
                      Log.e("inFFFF","FFFF "+time);// I somehow here get 16243428223995 nanoseconds which are too large because in reality it just take 1-2min.
                      }
  
                  }
  </code></pre>
  
  <p>If you are able please: 1. Tell me why time is larger than expected 2. Or suggest better way to calculate time that is being elapsed.</p>