Created
June 9, 2018 23:49
-
-
Save aikar/f802ca0c8bd38bf95af7ed6075c2435e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (c) 2016. Starlis LLC / dba Empire Minecraft | |
* | |
* This source code is proprietary software and must not be redistributed without Starlis LLC's approval | |
* | |
*/ | |
package com.empireminecraft.util; | |
import co.aikar.timings.Timing; | |
public abstract class TimedRunnable implements Runnable { | |
private final Timing timing; | |
public TimedRunnable(String name) { | |
timing = Util.timings(name); | |
} | |
@Override | |
public void run() { | |
try (Timing ignored = timing.startTimingIfSync()) { | |
runTimed(); | |
} | |
} | |
public abstract void runTimed(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment