自动追踪使用应用程序的时间 Thyme

码农软件 · 软件分类 · 其他开发相关 · 2019-10-18 06:42:22

软件介绍

Thyme 可以自动追踪你使用应用程序的时间。

特性:

简单的命令行界面:

每 30s 记录一次你使用的应用

$ while true; do thyme track -o thyme.json; sleep 30s; done;

在新窗口创建图表以显示应用使用时间

$ thyme show -i thyme.json -w stats > thyme.html

安装:

安装 Go:

$ go get -u github.com/sourcegraph/thyme/cmd/thyme

按照 thyme.dep 打印的说明

$ thyme dep

校验 thyme

$ thyme track

使用示例

var trackCmd TrackCmd
func (c *TrackCmd) Execute(args []string) error {
t, err := getTracker()
if err != nil {
return err
}
snap, err := t.Snap()
if err != nil {
return err
}
if c.Out == "" {
out, err := json.MarshalIndent(snap, "", "  ")
if err != nil {
return err
}
fmt.Println(string(out))
} else {
var stream thyme.Stream
if _, err := os.Stat(c.Out); err == nil {
if err := func() error {
f, err := os.Open(c.Out)
if err != nil {
return err
}
defer f.Close()
if err := json.NewDecoder(f).Decode(&stream); err != nil {
return err
}
return nil
}(); err != nil {
return err
}
} else if !os.IsNotExist(err) {
return err
}
stream.Snapshots = append(stream.Snapshots, snap)
f, err := os.Create(c.Out)
if err != nil {
return err
}
if err := json.NewEncoder(f).Encode(stream); err != nil {
return err
}
}
return nil
}

本文地址:https://codercto.com/soft/d/16999.html

An Introduction to the Analysis of Algorithms

An Introduction to the Analysis of Algorithms

Robert Sedgewick、Philippe Flajolet / Addison-Wesley Professional / 1995-12-10 / CAD 67.99

This book is a thorough overview of the primary techniques and models used in the mathematical analysis of algorithms. The first half of the book draws upon classical mathematical material from discre......一起来看看 《An Introduction to the Analysis of Algorithms》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

URL 编码/解码
URL 编码/解码

URL 编码/解码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具