Calculation disk usage of build after its completion and add time out for calculation disk usage of workspace

I add time out for calculation of workspace due to situation in which there is something wrong with slave and it stops communicate during waiting for result and Jenkins  does not recognize it.