use of com.earth2me.essentials.ExecuteTimer in project Essentials by drtshock.
the class KeywordReplacer method replaceKeywords.
private void replaceKeywords(final CommandSource sender) {
execTimer = new ExecuteTimer();
execTimer.start();
User user = null;
if (sender.isPlayer()) {
user = ess.getUser(sender.getPlayer());
}
execTimer.mark("User Grab");
for (int i = 0; i < input.getLines().size(); i++) {
String line = input.getLines().get(i);
final Matcher matcher = KEYWORD.matcher(line);
while (matcher.find()) {
final String fullMatch = matcher.group(0);
final String keywordMatch = matcher.group(1);
final String[] matchTokens = KEYWORDSPLIT.split(keywordMatch);
line = replaceLine(line, fullMatch, matchTokens, user);
}
replaced.add(line);
}
execTimer.mark("Text Replace");
final String timeroutput = execTimer.end();
if (ess.getSettings().isDebug()) {
ess.getLogger().log(Level.INFO, "Keyword Replacer " + timeroutput);
}
}
Aggregations