-
Notifications
You must be signed in to change notification settings - Fork 18
sys_util
Green Luo edited this page Jun 29, 2015
·
4 revisions
OSGL tool provides expressive way to access few commonly used system functions.
// old way
long ts = System.currentTimeMillis();
// new way
long ts = _.ms();
// old way
long ns = System.nanoTime();
// new way
long ns = _.ns();
long ns = _.ts();
// old way
String versionStr = System.getProperty("java.specification.version");
int pos = versionStr.lastIndexOf('.');
int version = Integer.parseInt(versionStr.substring(pos + 1));
// new way
int version = _.JAVA_VERSION