Mirror of Svelto.ECS because we're a fan of it
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
457B

  1. using System;
  2. namespace Svelto.ECS
  3. {
  4. public static class ProcessorCount
  5. {
  6. public static readonly int processorCount = Environment.ProcessorCount;
  7. public static int BatchSize(uint totalIterations)
  8. {
  9. var iterationsPerBatch = totalIterations / processorCount;
  10. if (iterationsPerBatch < 64)
  11. return 64;
  12. return (int) iterationsPerBatch;
  13. }
  14. }
  15. }