How to fetch cpu and memory usage values after ftp login?

Running htop/top command opens another screen from which i cannot fetch data into my script because it does not return some value. ps command doesn’t give live updates about cpu/mem usage. How are we supposed to get these values? Is there a different command for this?

Please Refer this : Doubt in output of top command