lundi 28 mai 2018

Select interval for a logic if condition

I have a number 0-59, or 60 minutes, and I want to do an if logic for every 5 minutes: 0, 5, 10, 15 and etc. How do I write a good if statement?

Here is what I come up with.

if( ((tmin/5) == thr) && ((tmin%5) ==0 ) ) { //DO Whatever}

It works and all, but I need something faster.

Aucun commentaire:

Enregistrer un commentaire