The majority of monitors have multiple input ports on the back. You can use different cables to connect both computers to your monitor simultaneously. Then, using the monitor's input selection, you can choose which computer's output you see by using the control buttons on the back or side (or remote control if it has one).