Skip to content

Commit

Permalink
Change a few uses of math to TimeConversionUtil
Browse files Browse the repository at this point in the history
  • Loading branch information
LadyCailin committed May 5, 2018
1 parent dc1c688 commit 95670d2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Expand Up @@ -3,6 +3,7 @@
import com.laytonsmith.PureUtilities.ClassLoading.ClassDiscovery;
import com.laytonsmith.PureUtilities.ClassLoading.ClassMirror.ClassMirror;
import com.laytonsmith.PureUtilities.Common.StreamUtils;
import com.laytonsmith.PureUtilities.Common.TimeConversionUtil;
import com.laytonsmith.PureUtilities.VirtualFS.VirtualFileSystemSettings.VirtualFileSystemSetting;
import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -119,7 +120,7 @@ public void run() {
try {
FSSize = FileUtils.sizeOfDirectoryAsBigInteger(root);
//Sleep for a minute before running again.
Thread.sleep(60 * 1000);
Thread.sleep(TimeConversionUtil.inMilliseconds(1, TimeConversionUtil.TimeUnit.MINUTE));
} catch(InterruptedException ex) {
Logger.getLogger(VirtualFileSystem.class.getName()).log(Level.SEVERE, null, ex);
}
Expand Down
Expand Up @@ -25,6 +25,7 @@
import com.laytonsmith.PureUtilities.Common.ReflectionUtils;
import com.laytonsmith.PureUtilities.Common.StreamUtils;
import com.laytonsmith.PureUtilities.Common.StringUtils;
import com.laytonsmith.PureUtilities.Common.TimeConversionUtil;
import com.laytonsmith.PureUtilities.ExecutionQueue;
import com.laytonsmith.PureUtilities.SimpleVersion;
import com.laytonsmith.PureUtilities.TermColors;
Expand Down Expand Up @@ -576,7 +577,9 @@ public boolean onCommand(CommandSender sender, Command cmd, String commandLabel,
if(sender instanceof ConsoleCommandSender) {
int interpreterTimeout = Prefs.InterpreterTimeout();
if(interpreterTimeout != 0) {
interpreterUnlockedUntil = (interpreterTimeout * 60 * 1000) + System.currentTimeMillis();
interpreterUnlockedUntil =
TimeConversionUtil.inMilliseconds(interpreterTimeout, TimeConversionUtil.TimeUnit.MINUTE)
+ System.currentTimeMillis();
sender.sendMessage("Interpreter mode unlocked for " + interpreterTimeout + " minute"
+ (interpreterTimeout == 1 ? "" : "s"));
}
Expand Down

0 comments on commit 95670d2

Please sign in to comment.