Script Takes time to compile in unity

Hi in a empty project, i made script and added couple of codes like player movments , varaibles
when i back to unity it takes like 6+ seconds to compile in unity how can i make it faster?

No, you most likely can’t make it any faster besides buying faster hardware (fast PC + SSD). When you switch back to Unity, Unity has to check if files got edited and then recompile all scripts. The C# compiler is already a very fast compiler. Have you ever worked with C++? For big projects the compilation times of a C++ project could take hours.

On my machine (I don’t have an SSD) it usually takes 2-3 seconds after I switch back to Unity until Unity actually starts compiling. The compilation itself only takes a fraction of a second on my machine. Over all (wait time, compilation, display of results / errors) it takes about 4 - 6 seconds.