1 Star 0 Fork 0

Survivor_zzc / gonx

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
bufio_read.go 486 Bytes
一键复制 编辑 原始数据 按行查看 历史
// Example program that reads big nginx file from stdin line by line
// and measure reading time. The file should be big enough, at least 500K lines
package main
import (
"bufio"
"fmt"
"os"
"time"
)
func main() {
scanner := bufio.NewScanner(os.Stdin)
var count int
start := time.Now()
for scanner.Scan() {
// A dummy action, jest read line by line
scanner.Text()
count++
}
duration := time.Since(start)
fmt.Printf("%v lines readed, it takes %v\n", count, duration)
}
1
https://gitee.com/zzcadmin/gonx.git
git@gitee.com:zzcadmin/gonx.git
zzcadmin
gonx
gonx
v1.3.1

搜索帮助