6
\$\begingroup\$

I'm using Unity3D. I have an automated test suite that takes 1-2 minutes to run. When Unity has focus, these tests seem to run at least 2x as fast as when Unity is in the background. But, it's very boring to stare at a progress bar for 1-2 minutes while I wait for the tests to complete. The whole reason I want to put it in the background is so I can do something else while these tests are running, but because it slows down the tests to 2-4 minutes, doing so makes me even less efficient.

Is there a way to have Unity run as fast as it does when it's focused, even when it's not focused?

This could be a Windows 10 question more than a Unity question. Maybe there's a way to set the Unity process as "high priority" or something.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ You can set the priority in the task manager under the details tab (right click the exe), but not sure if it'll help \$\endgroup\$ Commented Mar 21, 2019 at 10:44
  • \$\begingroup\$ Have you tried ` Edit-->Project Settings-->Player-->Resolution and Presentation-->Run In Backgound ` \$\endgroup\$ Commented Mar 2, 2020 at 21:23

1 Answer 1

1
\$\begingroup\$

I would try using the command line flags -batchmode -nographics see command line flags and make sure framerate is uncapped: somewhere write if (Application.isBatchMode) { Application.targetFrameRate = -1; }

If you don't need physics, you can "turn off" physics with Time.fixedDeltaTime = 10; to save some CPU (raycasts will still work).

\$\endgroup\$
1

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.