astro/basic/moon_test.go

28 lines
602 B
Go
Raw Normal View History

2019-10-24 10:44:21 +08:00
package basic
import (
"fmt"
"testing"
"time"
)
2022-01-04 14:24:44 +08:00
func Benchmark_MoonRiseBench(b *testing.B) {
jde := GetNowJDE()
for i := 0; i < b.N; i++ {
GetMoonRiseTime(jde, 115, 32, 8, 0, 10)
}
}
2019-10-24 10:44:21 +08:00
func Test_MoonS(t *testing.T) {
//fmt.Println(Sita(2451547))
//fmt.Println(MoonHeight(2451547, 115, 32, 8))
a := time.Now().UnixNano()
2022-01-04 14:24:44 +08:00
b := GetMoonRiseTime(GetNowJDE(), 115, 32, 8, 0, 10)
fmt.Println(HMoonHeight(b, 115, 32, 8))
2019-10-24 10:44:21 +08:00
fmt.Println(time.Now().UnixNano() - a)
fmt.Println(JDE2Date((b)))
fmt.Println(time.Now().UnixNano() - a)
//fmt.Printf("%.14f", GetMoonRiseTime(2451547, 115, 32, 8, 0))
2022-01-04 14:24:44 +08:00
}