def lowerCurrentProcessPriority():
if buildcommon.isWindows():
import win32process, win32api,win32con
win32process.SetPriorityClass(win32api.GetCurrentProcess(), win32process.BELOW_NORMAL_PRIORITY_CLASS)
else:
# on unix, people may run nice before executing the process, so
# only change the priority unilaterally if it's currently at its
# default value
if os.nice(0) == 0:
os.nice(1) # change to 1 below the current level
评论列表
文章目录