record the time cost in filter function