繁体   English   中英

在MySQL中存储System.currentTimeMillis()的输出

[英]Storing output of System.currentTimeMillis() in mysql

我正在使用System.currentTimeMillis(); Java中的function函数来计算程序花费的时间。 我必须将程序运行10次迭代并报告平均结果。 如果我存储System.currentTimeMillis()的输出; 作为两倍的功能将是可以接受的。

System.currentTimeMillis()返回一个long,它需要8个字节。 如果要将该值存储在mysql中,则等效值为BIGINT,它也是8个字节。

参考文献:

Java的

https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html

MySQL的

http://dev.mysql.com/doc/refman/5.7/en/integer-types.html

计算的平均值可能是一个十进制值,因此仅平均值必须是double类型。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM