Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///Time steps for kitchen timer....
- int time_step (int seconds) {
- // Returns a suitable maximum amount of step in seconds when changing a timer, based on the current value
- if (seconds < 60) {
- return 5; // < 1min
- } else if (seconds < 5 * 60) {
- return 10; // < 5min
- } else if (seconds < 30 * 60) {
- return 30; // < 30min
- } else if (seconds < 60 * 60) {
- return 60; // <1h
- } else if (seconds < 2 * 60 * 60) {
- return 5 * 60; // <2h
- } else if (seconds < 3 * 60 * 60) {
- return 15 * 60; // <3h
- } else if (seconds < 12 * 60 * 60) {
- return 30 * 60; // <12h
- } else {
- return 60 * 60;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment