(b *testing.B)
| 384 | } |
| 385 | |
| 386 | func BenchmarkSystem_SpawnStop(b *testing.B) { |
| 387 | system := NewSystem("bench") |
| 388 | defer system.Shutdown() |
| 389 | |
| 390 | for b.Loop() { |
| 391 | pid := system.Spawn(&EchoActor{}, "actor") |
| 392 | system.Stop(pid) |
| 393 | time.Sleep(time.Microsecond) // 确保清理完成 |
| 394 | } |
| 395 | } |