I have a function that is doing some calculation, i want to add jquery loader for some time for this, i have tried the following but it is not displaying the loader not getting why?

```
 function onChangeLeaveEndDate() {
    //$('.k-loading-mask').css('display', 'block !important');
    $(".k-loading-mask").show();
    setTimeout(function () {
        test();
    }, 10000);
    $('.k-loading-mask').hide();
}

```

did id do any wrong code in above? please help me how can i show a loader for specific period of time.