gconsoletime

package module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2019 License: MIT Imports: 2 Imported by: 0

README

go-consoletime

consoletime is a golang small package for log any execute time of each code stagement

Install

go get github.com/spksoft/go-consoletime

Using

// main.go
package main

import (
	consoletime "github.com/spksoft/go-consoletime"
)

func main() {
	consoletime.Log("Loop#1") // Log time for Loop#1
	for i := 0; i < 10000000000; i++ {
	}
	consoletime.Log("Loop#1") // End log time of Loop#1 and display it
	consoletime.Log("Loop#2") // Log time for Loop#2
	for i := 0; i < 10000000000; i++ {
	} 
    consoletime.Log("Loop#2") // End log time of Loop#1 and display it

}

Display on console

$ go run main.go
2019/11/16 02:52:08 Loop#1 took 2.68317789s
2019/11/16 02:52:10 Loop#2 took 2.684548133s

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Log

func Log(name string)

Log is a function push and pop time of called

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL