上一页 1 ··· 42 43 44 45 46 47 48 49 50 ··· 78 下一页
摘要: 写代码过程中,有时需要分析代码块的时间消耗。 本文介绍使用time包中的Since函数查看程序执行时间。 package main import ( "fmt" "time" ) func main() { t := time.Now() fmt.Println("Hello") for i:=0; 阅读全文
posted @ 2022-10-17 10:31 opensmarty 阅读(281) 评论(0) 推荐(0)
摘要: 1. os包 1.1 Write()/WriteString()方法 语法 打开文件 func OpenFile(name string, flag int, perm FileMode) (*File, error) 写入 func (f *File) WriteString(s string) 阅读全文
posted @ 2022-10-17 10:23 opensmarty 阅读(1168) 评论(0) 推荐(0)
摘要: 网络通信中,为了防止长时间无响应的情况,经常会用到网络连接超时、读写超时的设置。 本文结合例子简介golang的连接超时和读写超时设置。 1.超时设置 1.1 连接超时 func DialTimeout(network, address string, timeout time.Duration) 阅读全文
posted @ 2022-10-17 10:09 opensmarty 阅读(1352) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2022-10-08 09:27 opensmarty 阅读(0) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2022-09-20 15:31 opensmarty 阅读(0) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2022-09-20 10:35 opensmarty 阅读(0) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2022-09-20 10:21 opensmarty 阅读(0) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2022-09-16 14:24 opensmarty 阅读(0) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2022-09-16 11:11 opensmarty 阅读(0) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2022-09-16 10:58 opensmarty 阅读(0) 评论(0) 推荐(0)
上一页 1 ··· 42 43 44 45 46 47 48 49 50 ··· 78 下一页