Anders Sandberg's answer assumed a black hole that somehow is already embedded in the Sun's core and stays there (despite travelling at an ultra-relativistic speed). In reality, a ten Earth mass black hole would fly straight through the Sun, hardly noticing that its there. Along the way it would "eat up" a tunnel of Solar material smaller than $0.04 m^2$, which would amount to about $10^{-15}$ Earth mass worth of material, which would only lead to a very minute perturbation of the black hole's orbit around the center of mass of the solar system.
If the black hole started on a bound orbit, this orbit will stay bound, and the black hole will pass through the Sun at each perihelium passage. However, it will take order $10^{16}$ such passages for the black hole to even double in size (let alone eat up the star). Given that observations exclude the presence of such a heavy object in the inner solar system, its period must be tens if not hundreds of years. So the time for it double in mass is going to be thousands to millions times the age of the Universe. This is also the timescale on which its orbit would start to change significantly due to backreaction of the absorption.*
Finally, we should remark that it is highly unlikely for the black hole to be on a trajectory that would even hit the Sun in the first place. It is much more realistic for the black hole to be on an elliptic (or hyperboloidal) orbit around the Sun, like all other objects in the solar system.
*Dynamical drag of the gas in the Sun likely has a much larger impact on the orbit, but is much harder to estimate. If the velocity is high enough it should still be fairly insignificant though.