码迷,mamicode.com
首页 >  
搜索关键字:perf_counter    ( 27个结果
python预课02 time模块,文本进度条示例,数字类型操作,字符串操作
time模块 概述:time库是Python中处理时间的标准库,包含以下三类函数 时间获取: time(), ctime(), gmtime() 时间格式化: strftime(), strptime() 程序计时: sleep(), perf_counter() 时间获取: 时间格式化: 1.st ...
分类:编程语言   时间:2019-10-23 19:57:23    阅读次数:83
Python time库
1.调用系统当前时间 perf_counter() ...
分类:编程语言   时间:2019-10-20 16:17:13    阅读次数:89
计算思维:蒙特卡罗方法求“圆周率”
#CalPiV2.pyfrom random import randomfrom time import perf_counterDARTS = 1000*1000hits=0.0start = perf_counter()for i in range(1,DARTS+1): x,y = rando ...
分类:其他好文   时间:2019-07-23 11:33:45    阅读次数:120
用python计算圆周率
from random import randomfrom time import perf_counterDARTS = 1000 * 1000hits = 0.0start = perf_counter()for i in range(1,DARTS+1): x,y = random(),ran ...
分类:编程语言   时间:2019-03-21 01:07:23    阅读次数:524
有进度条的圆周率计算
import mathimport time scale=14s,m,=1,2print("执行开始".center(scale//2, "-"))start = time.perf_counter()for i in range(scale+1): s=math.sqrt((1-math.sqrt ...
分类:其他好文   时间:2019-03-17 10:42:55    阅读次数:152
圆周率--习题
from random import randomfrom time import perf_counterDARTS=1000*1000hits=0.0start=perf_counter()for i in range(1,DARTS+1): x,y=random(),random() dist... ...
分类:其他好文   时间:2019-03-03 19:05:12    阅读次数:412
python3-求素数
importtimeimportmathstart=time.perf_counter()print("2")forninrange(3,101):foriinrange(2,int(math.sqrt(n))+1):if(n%i==0):print("{2}不是素数:{0}*{1}={2}".format(int(n/i),i,n))breakelse:print("{0}是素数".format
分类:编程语言   时间:2018-12-03 20:20:56    阅读次数:188
time库
import time time.(b) 三类 时间获取 time() 当前时间戳 ctime() 当前时间易读 gmtime() 当前时间计算机识别 时间格式化 strftime() strptime() 将字符串->时间 程序计时 sleep() perf_counter() strftime( ...
分类:其他好文   时间:2018-10-25 14:23:28    阅读次数:231
zabbix 3.2 监控Windows 实时内存使用率与CPU使用率
环境介绍:zabbix3.2模板:TemplateOSwindows监控主机:windowsserver2008r2主机已经安装:zabbixagentd3.2.11代理注:使用模板监控的时候1、监控项只能获取到CPU的1分钟5分钟15分钟的平均值,不能查看到实时的CPU峰值。2、监控内存只能查看内存的剩余量,无法查看实时峰值。操作介绍:cpu监控key值:perf_counter[\Proces
分类:Windows程序   时间:2018-08-24 18:10:27    阅读次数:399
模拟进度条
1 #模拟进度条 2 import time 3 scale = 50 4 t = time.perf_counter() 5 print("执行开始".center(scale // 2, "-")) 6 for i in range(1, scale + 1): 7 a, b = "*" * i... ...
分类:其他好文   时间:2018-05-25 11:15:22    阅读次数:202
27条   上一页 1 2 3 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!