spinrite_test.go 847 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package door
  2. import "testing"
  3. func BenchmarkSpinRite(b *testing.B) {
  4. Unicode = false
  5. var spin SpinRite = SpinRiteInit(15, 5,
  6. ColorText("RED ON GREEN"))
  7. for i := 0; i < b.N; i++ {
  8. spin.Output()
  9. }
  10. }
  11. func BenchmarkSpinRiteMsg(b *testing.B) {
  12. Unicode = false
  13. var spin SpinRiteMsg = SpinRiteMsgInit(15, 5,
  14. ColorText("RED ON GREEN"),
  15. []string{"RED", "GREEN", "SOFTWARE"})
  16. for i := 0; i < b.N; i++ {
  17. spin.Output()
  18. }
  19. }
  20. func BenchmarkSpinRiteUnicode(b *testing.B) {
  21. Unicode = true
  22. var spin SpinRite = SpinRiteInit(15, 5,
  23. ColorText("RED ON GREEN"))
  24. for i := 0; i < b.N; i++ {
  25. spin.Output()
  26. }
  27. }
  28. func BenchmarkSpinRiteMsgUnicode(b *testing.B) {
  29. Unicode = true
  30. var spin SpinRiteMsg = SpinRiteMsgInit(15, 5,
  31. ColorText("RED ON GREEN"),
  32. []string{"RED", "GREEN", "SOFTWARE"})
  33. for i := 0; i < b.N; i++ {
  34. spin.Output()
  35. }
  36. }