• System类的方法


     arraycopy(Object src, int srcPos, Object dest, int destPos, int length)
                从指定源数组中复制一个数组,复制从指定的位置开始,到目标数组的指定位置结束 

     1 package system;
     2 /**
     3  * exit(int status)  终止当前正在运行的 Java 虚拟机。
     4                                   
     5    gc() 运行垃圾回收器
     6               
     7    currentTimeMillis() 返回以毫秒为单位的当前时间。
     8               
     9  * @author star
    10  *
    11  */
    12 public class SystemDemo1 {
    13 
    14     public static void main(String[] args) {
    15 //        System.out.println("hello");
    16 //        System.exit(0);
    17 //        System.out.println("world");
    18 
    19         
    20         //获取当前系统时间
    21 //        long time = System.currentTimeMillis();
    22 //        System.out.println(time);
    23 //        System.out.println(Long.MAX_VALUE);
    24         
    25         long start = System.currentTimeMillis();
    26         int sum = 0;
    27         for(int i = 0;i<1000000;i++){
    28 //            System.out.println("hello" + i);
    29             sum += i;
    30         }
    31         
    32         long end = System.currentTimeMillis();
    33         System.out.println("共耗时: " + (end - start) + "毫秒" + sum);
    34     }
    35 
    36 }
  • 相关阅读:
    redis改配置
    redis主从复制
    nginx做维护页面
    go_http
    DRF源码-views.py
    DRF教程10-关系字段
    语言特性
    DRF源码-fields.py
    python_@classmethod
    HTML5:定位
  • 原文地址:https://www.cnblogs.com/star521/p/8945786.html
Copyright © 2020-2023  润新知