master > master: code - metrics für moves

This commit is contained in:
RD
2021-11-06 18:21:16 +01:00
parent ab38c181c9
commit ef833533f6
5 changed files with 51 additions and 16 deletions

View File

@@ -17,6 +17,7 @@ import (
* ---------------------------------------------------------------- */
var _ctr_time = types.NewCounter()
var _ctr_moves = types.NewCounter()
var _ctr_space = types.NewCounter()
var _tmr = types.NewTimer()
@@ -26,6 +27,7 @@ var _tmr = types.NewTimer()
func ResetMetrics() {
_ctr_time.Reset()
_ctr_moves.Reset()
_ctr_space.Reset()
_tmr.Reset()
}
@@ -42,14 +44,26 @@ func AddTimeCost(options ...int) {
_ctr_time.Add(options...)
}
func AddMovesCost(options ...int) {
_ctr_moves.Add(options...)
}
func AddSpaceCost(options ...int) {
_ctr_space.Add(options...)
}
func SetSpaceCost(n int) {
_ctr_space.Set(n)
}
func GetTimeCost() int {
return _ctr_time.Size()
}
func GetMovesCost() int {
return _ctr_moves.Size()
}
func GetSpaceCost() int {
return _ctr_space.Size()
}