Package me.neznamy.tab.api.task
Interface ThreadManager
public interface ThreadManager
-
Method Summary
Modifier and TypeMethodDescriptionrunMeasuredTask(String feature, String type, Runnable task) Starts a task in new thread and measures how long it took to processrunMeasuredTask(TabFeature feature, String type, Runnable task) Starts a task in new thread and measures how long it took to processRuns task in a new threadFuture<?>runTaskLater(int delayMilliseconds, TabFeature feature, String type, Runnable task) Runs task with a delay and measures how long it took to processstartRepeatingMeasuredTask(int intervalMilliseconds, TabFeature feature, String type, Runnable task) Starts a new task with defined repeat interval that measures cpu usagestartRepeatingTask(int intervalMilliseconds, Runnable task)
-
Method Details
-
runMeasuredTask
Starts a task in new thread and measures how long it took to process- Parameters:
feature- feature to add cpu usage totype- usage type to add cpu usage totask- the task
-
runMeasuredTask
Starts a task in new thread and measures how long it took to process- Parameters:
feature- feature to add cpu usage totype- usage type to add cpu usage totask- the task
-
runTask
Runs task in a new thread- Parameters:
task- the task
-
startRepeatingMeasuredTask
RepeatingTask startRepeatingMeasuredTask(int intervalMilliseconds, TabFeature feature, String type, Runnable task) Starts a new task with defined repeat interval that measures cpu usage- Parameters:
intervalMilliseconds- task intervalfeature- feature to add cpu usage totype- usage type to add cpu usage totask- the task
-
startRepeatingTask
-
runTaskLater
Runs task with a delay and measures how long it took to process- Parameters:
delayMilliseconds- how long to run the task afterfeature- feature to add cpu usage totype- usage type to add cpu usage totask- the task- Returns:
- future allowing to cancel the task
-