-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fdb81c4
commit bd8b4b7
Showing
5 changed files
with
88 additions
and
20 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package java_common; | ||
|
||
import java.text.SimpleDateFormat; | ||
import java.util.Date; | ||
|
||
/** | ||
* Common methods | ||
* | ||
* @author ÌÆÁú | ||
*/ | ||
public class CommonMethod { | ||
/**get current time in the form of "yyyy-MM-dd HH:mm:ss"*/ | ||
public static final String TIME_NOW = getTimeNow(); | ||
private static String getTimeNow(){ | ||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
return sdf.format(new Date()); | ||
} | ||
|
||
/**get current time in the form of nanosecond*/ | ||
public static long nano() { | ||
return System.nanoTime(); | ||
} | ||
|
||
/**get current time in the form of millisecond*/ | ||
public static long milli() { | ||
return System.currentTimeMillis(); | ||
} | ||
} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package java_common; | ||
|
||
/** | ||
* The memory of JVM(M) | ||
* | ||
* @author ÌÆÁú | ||
* | ||
*/ | ||
public class JVMMemory { | ||
private final static int M = 1024*1024; | ||
static long maxMemory = Runtime.getRuntime().maxMemory()/M; | ||
static long totalUsedMemory = Runtime.getRuntime().totalMemory()/M; | ||
} |
This file was deleted.
Oops, something went wrong.