first commit

This commit is contained in:
2020-06-12 23:49:11 +02:00
commit ea19e5ad2a
214 changed files with 43291 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
package util;
/**
* This is a tool to time
*
* @param starttime This Parameter captures the time at the beginning of a program
* @param endtime This Parameter captures the time at the end of a program
* @Author BiteCoding --> https://github.com/BiteCoding
*/
import java.util.Date;
public class Timer {
private long starttime;
private long endtime;
public Timer() {
starttime = 0;
endtime = 0;
}
public void start() {
starttime = new Date().getTime();
}
public void end() {
endtime = new Date().getTime();
}
private long deltaTime() {
if (starttime == 0 || endtime == 0) {
return -1;
} else {
return endtime-starttime;
}
}
public String timeNeeded(){
return "Time needed " + deltaTime() + " ms";
}
}