Realtime & fix output log, optimine cpu usage

Realtime & fix output log, optimine cpu usage