首页
统计
关于
Search
1
C语言:获取程序运行消耗的时间(gettimeofday)
384 阅读
2
QT-利用Qcamera查看USB摄像头参数(数据帧格式+分辨率)
264 阅读
3
嵌入式linux组播接收发送失败解决
257 阅读
4
一切从头开始
188 阅读
5
Linux 查看硬盘通电时间
168 阅读
编程语言
C/C++
PHP
Go
分享
随笔
Linux
OpenHarmony
登录
Search
标签搜索
C++
QT
Linux
Git
Go
C
程序执行时间
函数执行时间
GDAL
zeromq
github
Centos
代理
goKit
gitea
247.1
累计撰写
30
篇文章
累计收到
0
条评论
首页
栏目
编程语言
C/C++
PHP
Go
分享
随笔
Linux
OpenHarmony
页面
统计
关于
搜索到
30
篇与
的结果
2023-05-18
解决使用git每次提交和拉取代码都要输入帐号密码的问题
1、首先,在git.bash文件中输入命令:git config --global credential.helper store2、然后你会发现你的C:\Users\用户名.gitconfig文件(或者是类似名称的)会多出以下代码:[credential] helper = store**3、使用git pull或者git push命令后,根据提示输入帐号和密码后,这时你的本地生成一个类似C:\Users\用户名.git-credentials文件,用于记录帐号密码。4、完成以上几步,下次就不用再次输帐号密码了。
2023年05月18日
15 阅读
0 评论
0 点赞
2023-05-08
C语言:获取程序运行消耗的时间(gettimeofday)
对于普通的C程序:#include<stdio.h> #include<sys/time.h> //注意引用这个头文件 #include<unistd.h> int delay(int time) { //这里用来表示你自己要运行的程序 } int main() { //定义两个结构体,来记录开始和结束时间 struct timeval start; struct timeval end; //记录两个时间差 unsigned long diff; //第一次获取时间,即表示开始记时 gettimeofday(&start,NULL); //运行自己的程序 delay(10); //第二次获取时间,即表示结束记时 gettimeofday(&end,NULL); //计算时间差,并打印 diff = 1000000 * (end.tv_sec-start.tv_sec)+ end.tv_usec-start.tv_usec; printf(“thedifference is %ld\n”,diff); return 0; }对于内核模块的C程序#include<stdio.h> //注意引用这个头文件 #include<linux/time.h> #include<unistd.h> int delay(int time) { //这里用来表示你自己要运行的程序 } int main() { //定义两个结构体,来记录开始和结束时间 struct timeval start; struct timeval end; //记录两个时间差 unsigned long diff; //第一次获取时间,即表示开始记时 do_gettimeofday(&start,NULL); //运行自己的程序 delay(10); //第二次获取时间,即表示结束记时 do_gettimeofday(&end,NULL); //计算时间差,并打印 diff = 1000000 * (end.tv_sec-start.tv_sec)+ end.tv_usec-start.tv_usec; printf(“thedifference is %ld\n”,diff); return 0; }
2023年05月08日
384 阅读
0 评论
0 点赞
2023-05-01
QT--程序收不到组播数据
主要需要设置组播网卡 QString strName = ui->comboBox_network->currentData().toString(); interface = QNetworkInterface::interfaceFromName(strName); // 根据选择名称获取网卡 QByteArray data; tftudpsocket = new QUdpSocket(); tftsendaddres.setAddress("239.1.1.15"); tftudpsocket->bind(QHostAddress(ip), 6002, QUdpSocket::ShareAddress | QUdpSocket::ReuseAddressHint); //加入组播组 tftudpsocket->setSocketOption(QAbstractSocket::MulticastLoopbackOption, 0); //设置组播网卡 tftudpsocket->setMulticastInterface(interface); tftudpsocket->joinMulticastGroup(QHostAddress(tftsendaddres), interface); connect(tftudpsocket, SIGNAL(readyRead()), this, SLOT(read_tftdata())); //发送一个空数据出去 tftudpsocket->writeDatagram(data, QHostAddress(tftsendaddres), 6002);
2023年05月01日
108 阅读
0 评论
0 点赞
2023-05-01
Linux 查看硬盘通电时间
查看硬盘通电时间Ubuntu / Debian:apt install smartmontools smartctl -A /dev/sdaCentOS:yum install smartmontools smartctl -A /dev/sda其中 /dev/sda 是硬盘编号,第一块一般是 /dev/sda,如果有多块硬盘,第二块就是 /dev/sdb,以此类推。一般我们会看到如下的输出:root@185a140b120c93:~# smartctl -A /dev/sda smartctl 6.5 2016-01-24 r4214 [x86_64-linux-4.13.11-041311-generic] (local build) Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org === START OF READ SMART DATA SECTION === SMART Attributes Data Structure revision number: 10 Vendor Specific SMART Attributes with Thresholds: ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE 1 Raw_Read_Error_Rate 0x0033 120 120 050 Pre-fail Always - 0/0 5 Retired_Block_Count 0x0033 100 100 003 Pre-fail Always - 0 9 Power_On_Hours_and_Msec 0x0032 076 076 000 Old_age Always - 21343h+10m+10.810s 12 Power_Cycle_Count 0x0032 081 081 000 Old_age Always - 19663 171 Program_Fail_Count 0x000a 000 000 000 Old_age Always - 0 172 Erase_Fail_Count 0x0032 000 000 000 Old_age Always - 0 174 Unexpect_Power_Loss_Ct 0x0030 000 000 000 Old_age Offline - 19660 177 Wear_Range_Delta 0x0000 000 000 000 Old_age Offline - 4 181 Program_Fail_Count 0x000a 000 000 000 Old_age Always - 0 182 Erase_Fail_Count 0x0032 000 000 000 Old_age Always - 0 187 Reported_Uncorrect 0x0012 100 100 000 Old_age Always - 0 189 Airflow_Temperature_Cel 0x0000 029 060 000 Old_age Offline - 29 (Min/Max -22/60) 194 Temperature_Celsius 0x0022 029 060 000 Old_age Always - 29 (Min/Max -22/60) 195 ECC_Uncorr_Error_Count 0x001c 120 120 000 Old_age Offline - 0/0 196 Reallocated_Event_Count 0x0033 100 100 003 Pre-fail Always - 0 201 Unc_Soft_Read_Err_Rate 0x001c 120 120 000 Old_age Offline - 0/0 204 Soft_ECC_Correct_Rate 0x001c 120 120 000 Old_age Offline - 0/0 230 Life_Curve_Status 0x0013 100 100 000 Pre-fail Always - 100 231 SSD_Life_Left 0x0013 026 026 010 Pre-fail Always - 0 233 SandForce_Internal 0x0032 000 000 000 Old_age Always - 128184 234 SandForce_Internal 0x0032 000 000 000 Old_age Always - 189875 241 Lifetime_Writes_GiB 0x0032 000 000 000 Old_age Always - 189875 242 Lifetime_Reads_GiB 0x0032 000 000 000 Old_age Always - 64285其中的“9”,“Power_On_Hours_and_Msec”,就是硬盘通电时间,可以看到我这块硬盘已经通电 21343h+10m+10.810s,算下来有两年半了。
2023年05月01日
168 阅读
0 评论
0 点赞
2023-04-10
QLineEdit添加左侧或右侧的图标
QAction *searchAction = new QAction(ui.LineEdit); searchAction->setIcon(QIcon(":/resource/query.png")); ui.LineEdit->addAction(searchAction,QLineEdit::TrailingPosition); //QLineEdit::LeadingPosition 在左侧
2023年04月10日
104 阅读
0 评论
0 点赞
1
...
4
5
6