import random
import time
from celery.decorators import task


@task(name='celery_long_computing')
def long_computing():
    """Computing task running a long time"""
    t0 = time.time()
    time.sleep(10 * random.random())
    result = random.randint(1000, 10000)
    elapsed_time = time.time() - t0

    return result, elapsed_time
