master > master: code - metrics für moves
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user