mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-07-27 21:12:00 +08:00
19 lines
298 B
Go
19 lines
298 B
Go
package querybuilder
|
|
|
|
import "math"
|
|
|
|
// ToNanoSecs takes epoch and returns it in ns
|
|
func ToNanoSecs(epoch uint64) uint64 {
|
|
temp := epoch
|
|
count := 0
|
|
if epoch == 0 {
|
|
count = 1
|
|
} else {
|
|
for epoch != 0 {
|
|
epoch /= 10
|
|
count++
|
|
}
|
|
}
|
|
return temp * uint64(math.Pow(10, float64(19-count)))
|
|
}
|