How to check if a database query has results? How do I check if the following code has results?

I tried the empty function but it always returns FALSE



$query = db_select('my_table', 't');
$query->condition('code', 10)
      ->fields('t', array('cid'));
$result = $query->execute();
If I'm correct the result of the execute() call should be a DatabaseStatementInterface which has a rowCount function.