package com.osnova;

public class Fps {
  
   // первый способ
  public static int FPS=30;
	 public static int tTime=1000/FPS;
	 public static long sTime;
	 public static long uTime;
	 public	 static long wTime; 
    
   // второй способ 
    
   public static float fps=60;
   	public static float second=1000000000;
   	public static float ut=second/fps;
	  public static float last;
   public static float delta;
  // public static float now,elapsed;
   
   
   
   ////// 1 
   
   public static void start_1(){
        
      sTime=System.nanoTime();  
        
    } 
    
    
   public static void fps_1(){
        
        
       uTime=(System.nanoTime()-sTime)/1000000;
				   wTime=tTime-uTime;
       
    }
    
   
   //// 2
    
    public static void start_2(){
      
      last=System.nanoTime();
	     delta=0;
      
      
      
   }
   
   
   
   public static void fps_2(){
      
    float now=System.nanoTime();
			 float elapsed=now-last;
				last=now;
				delta+=elapsed/ut;
      
      
      wTime=1;
       
   }
   
    
    
}
