The Library counting consecutive time
extend your own class or create your annoymous class.
you should provide fps for APIThread.
APIThread(int fps)
or
APIThread(TimeUnitFactory.unit, value)
ex) APIThread(TimeUnitFactory.MS, 100) = APIThread(10)
ex) APIThread(TimeUnitFactory.MINUTE, 2)
APIThreadthread = newAPIThread(TimeUnitFactory.SECOND, 1) {
inttime;
/*when one tick is passed*/@OverridepublicvoidonThreadExecute() throwsInterruptedException {
System.out.println(++time + " Sec");
}
/*if your code on onThreadExecute() is too very heavy to calculate time normally, The ThreadAPI create new time calculation and refresh. then, this method is called.*/@OverridepublicvoidonKeepUp() {
}
/*when you call APIPause or etc, The ThreadAPI wakes up Thread.sleep(). then, this method is called*/@OverridepublicvoidonInterrupt() {
}
/*when you start thread, this method is called*/@OverridepublicvoidonStart() {
}
/*when you call APIPause(), this method is called*/@OverridepublicvoidonPause() {
}
/*when you call APIResume(), this methoid is called*/@OverridepublicvoidonResume() {
}
/*when you call APIStop(), this method is called*/@OverridepublicvoidonStop() {
}
};
// start threadthread.start();Good Luck!
by GoldenMine (Korean)
blog.naver.com/ehe123