幽灵资源网 Design By www.bzswh.com
一 基本知识
millisecond 毫秒
microsecond 微秒
nanosecond 纳秒
1秒=1000毫秒 1毫秒=1000微秒 1微秒=1000纳秒
二 perl
perl中可以使用time或localtime来获得时间,time返回从1970年1月1日0点的秒数,localtime返回当前时间的字符串表示,或者年月日等得tuple表示。
#!/usr/bin/perl use strict; use warnings; use POSIX qw(strftime); # seconds from 1970.01.01 00:00:00 my $ti = time(); print $ti; print "\n"; print strftime("%Y-%m-%d %H:%M:%S\n", localtime($ti)); #1310623469 #2011-07-14 14:03:58 my $t = localtime(); print $t; print "\n"; #Thu Jul 14 12:25:16 2011 my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst)=localtime(); print $year; print "\n"; #111 print strftime("%Y-%m-%d %H:%M:%S\n", localtime()); #2011-07-14 12:26:01
三 c#
1tick = 100 nanosecond
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace MyTest { class Program { static void DateTimeTest() { DateTime dt2 = DateTime.Now; Console.WriteLine(dt2.Ticks); Console.WriteLine(dt2.ToString("MM/dd/yyyy hh:mm:ss")); } static DateTime"MM/dd/yyyy hh:mm:ss")); } return dt; } static void Main(string[] args) { DateTimeTest(); ConvertPerlTimeToDateTime("1309423883"); //634462479788396720 //07/14/2011 01:46:18 //06/30/2011 08:51:23 } } }
四 python
python的perl相似,time也是从1970年1月1日开始的秒数。
import time ISOTIMEFORMAT='%Y-%m-%d %X' # seconds from 1970.01.01 00:00:00 t = time.time() print (t) print time.strftime(ISOTIMEFORMAT,time.localtime(t)) #1310623143.12 #2011-07-14 13:59:03 (year,mon,day,hour,min,sec,wday,yday,isdst) = time.localtime() print (year) print (time.strftime(ISOTIMEFORMAT, time.localtime())) #2011 #2011-07-14 13:59:03
标签:
时间,转化
幽灵资源网 Design By www.bzswh.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
幽灵资源网 Design By www.bzswh.com
暂无评论...
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。