calculating algo time