| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| JThequeCoreTimer |
|
| 1.0;1 |
| 1 | package org.jtheque.core.managers.lifecycle; | |
| 2 | ||
| 3 | import org.jtheque.core.managers.Managers; | |
| 4 | import org.jtheque.core.managers.log.ILoggingManager; | |
| 5 | ||
| 6 | /* | |
| 7 | * This file is part of JTheque. | |
| 8 | * | |
| 9 | * JTheque is free software: you can redistribute it and/or modify | |
| 10 | * it under the terms of the GNU General Public License as published by | |
| 11 | * the Free Software Foundation, either version 3 of the License. | |
| 12 | * | |
| 13 | * JTheque is distributed in the hope that it will be useful, | |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 16 | * GNU General Public License for more details. | |
| 17 | * | |
| 18 | * You should have received a copy of the GNU General Public License | |
| 19 | * along with JTheque. If not, see <http://www.gnu.org/licenses/>. | |
| 20 | */ | |
| 21 | ||
| 22 | /** | |
| 23 | * A timer for JTheque Core. | |
| 24 | * | |
| 25 | * @author Baptiste Wicht | |
| 26 | */ | |
| 27 | public final class JThequeCoreTimer { | |
| 28 | private static long startTime; | |
| 29 | ||
| 30 | /** | |
| 31 | * This class is not instanciable, this is an utility. | |
| 32 | */ | |
| 33 | private JThequeCoreTimer() { | |
| 34 | 0 | super(); |
| 35 | 0 | } |
| 36 | ||
| 37 | /** | |
| 38 | * Start the timer. | |
| 39 | */ | |
| 40 | public static void start() { | |
| 41 | 0 | startTime = System.currentTimeMillis(); |
| 42 | 0 | } |
| 43 | ||
| 44 | /** | |
| 45 | * Stop the timer. | |
| 46 | */ | |
| 47 | public static void stop() { | |
| 48 | 0 | long time = System.currentTimeMillis() - startTime; |
| 49 | ||
| 50 | 0 | Managers.getManager(ILoggingManager.class).getLogger(JThequeCoreTimer.class).debug("JTheque start took {} ms", time); |
| 51 | 0 | } |
| 52 | } |