Product status check in Magento

$stock _status =  $_product->getStockItem();
if ($stock_status->getIsInStock()) {
echo ” in stock”;
} else {
echo “out of stock”;
}