github.com/v2pro/plz@v0.0.0-20221028024117-e5f9aec5b631/countlog/timer.go (about)

     1  package countlog
     2  
     3  import (
     4  	"github.com/v2pro/plz/countlog/spi"
     5  	"time"
     6  )
     7  
     8  func TraceTimer() int64 {
     9  	if LevelTrace < spi.MinLevel {
    10  		return 0
    11  	}
    12  	return time.Now().UnixNano()
    13  }
    14  
    15  func DebugTimer() int64 {
    16  	if LevelDebug < spi.MinLevel {
    17  		return 0
    18  	}
    19  	return time.Now().UnixNano()
    20  }
    21  
    22  func InfoTimer() int64 {
    23  	if LevelInfo < spi.MinLevel {
    24  		return 0
    25  	}
    26  	return time.Now().UnixNano()
    27  }