zoukankan
html css js c++ java
MFC 的几个常用函数,用来计算文件大小,下载速度,转换时间的
//获取文件的大小,并以KB 或 MB 来表示 CString GetFileSize(LONG size) { CString _size; //判断大小有没有超过1 if (size<(1024*1024)) { _size.Format("%.2lfKB",size/1024.0); }else if(1024*1024*1024) { _size.Format("%.2lfMB",(size/1024.0)/1024.0); }else { _size.Format("%.2lfGB",(size/1024.0/1024.0)/1024.0); } return _size; } //获取下载速度的字符串 CString GetFileTranSpeed(DWORD size,DWORD time) { CString _speed; //判断时间是否为0 if (time>0){ if (size/1024*1000.0/time<1024) { _speed.Format("%.2lfKB/s",size/1024*1000.0/time); }else { _speed.Format("%.2lfMB/s",(size/1024)*1000.0/time); } }else { return _speed = "0KB/s"; } return _speed; } //获取时间的字符串 CString GetTimeFormatStr(LONG time) { CString _time; int hh = time/3600; int mm = (time-hh*3600)/60; int ss = time%60; _time.Format("%d%d:%d%d:%d%d",hh/10,hh%10,mm/10,mm%10,ss/10,ss%10); return _time; }
查看全文
相关阅读:
1000F.One Ocurrence(可持久化线段树+思维)
P2184.贪婪大陆(思维+树状数组)
438D.The Child and Sequence(线段树+取模性质)
P2894 [USACO08FEB]Hotel G(线段树维护区间子串)
620E New Year Tree(线段树维护状压)
P6492 [COCI2010-2011#6] STEP(线段树维护最长子串)
242E.XOR on segment(线段树维护区间异或)
1527D.MEX Tree(树上分类讨论+容斥)
解决for循环中写异步函数,异步函数中输出下标一样问题
vue拦截器
原文地址:https://www.cnblogs.com/javawebsoa/p/2458432.html
最新文章
cron脚本执行要点
Centos 7 中关闭 swap
linux 主机名命名规范
openfalcon 使用记录
c程序编译错误处理办法
ansible when条件语句用法
单用户模式和救援模式
查看kafka版本号
windows 安装redis
Django: You are trying to add a non-nullable field 'name' to mainnav without a default; we can't do that (the database needs something to populate existing rows).
热门文章
Django: Invalid block tag on line 5: 'static', expected 'endblock'. Did you forget to register or load this tag?
Django: 'block' tag with name 'header' appears more than once
Django:django.core.exceptions.ImproperlyConfigured: Specifying a namespace in include() without providing an app_name is not supported.
Django: ERRORS: ?: (staticfiles.E001) The STATICFILES_DIRS setting is not a tuple or list. HINT: Perhaps you forgot a trailing comma?
error: failed to push some refs to 'https://gitee.com/xxxxxxxxx/xxxxxxxt'
Cannot use v-for on stateful component root element because it renders multiple elements.
图标字体库
uni-app学习之路
1486F.Pairs of Paths(树链剖分+容斥)
1004F.Sonya and Bitwise OR(毒瘤线段树+分治思想)
Copyright © 2011-2022 走看看