python问题,请教下如何并发执行函数,并且可以自定义并发量

代码如下,现在想点击btn按钮,能够并发执行timer_fun(),并且并发量可以设置,请问有什么办法


    def __init__(self):
        self.count = 0
        
        # 声明定时器
        self.timer = QTimer()
        self.timer.setInterval(1000)
        self.timer.timeout.connect(self.timer_fun)
        
        self.ui.btn.clicked.connect(self.btn_event)
    
    def btn_event(self):
        #点击执行定时器
        self.timer.start()
 
    def timer_fun(self):
        # N次后停止定时器
        self.count += 1
        if self.count > 100:
            self.timer.stop()
        # 下面加你要执行的内容
        print(123)

img