Here you can find the source of onMinute(int minute)
Parameter | Description |
---|---|
minute | What minute, for instance checking on 5 will trigger every 5 minutes |
public static boolean onMinute(int minute)
//package com.java2s; /**// w ww . j a v a2 s. co m * This file was created for Bookshelf * * Bookshelf is licensed under the * Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License: * http://creativecommons.org/licenses/by-nc-sa/4.0/ * * @author Paul Davis - pauljoda * @since 2/14/2017 */ public class Main { public static long tick = 0; /** * Used to check if the current minutes is on the time multiple of the given variable * @param minute What minute, for instance checking on 5 will trigger every 5 minutes * @return True if on time */ public static boolean onMinute(int minute) { return minutes() % minute == 0; } /** * How many minutes on * * @return Minutes, floored */ public static int minutes() { return (int) Math.floor(seconds() / 60); } /** * The seconds online * * @return How many seconds on, floored */ public static int seconds() { return (int) Math.floor(tick / 20); } }