Call a function without waiting for it

前端 未结 6 1383
粉色の甜心
粉色の甜心 2021-02-02 00:59

Hi I was wondering if there was a way of calling a function/method (preferably in Python or Java) and continue execution without waiting for it.

Example:



        
6条回答
  •  隐瞒了意图╮
    2021-02-02 01:46

    Using multiprocessing in python:

    from multiprocessing import Process
    
    def b():
        # long process
    
    p = Process(target=b) 
    p.start()
    

提交回复
热议问题