The answer depends, as you can see here, in many things. What the compiler will do with your C code depends on many things. If we are talking about x86-32, this should be generally applicable.
At a basic level, your C code points to a memory variable that requires at least one command to be multiplied by two: "shl mem, 1", and in such a simple case, C code will be slower.
If num is a local variable, the compiler may decide to put it in the register (if it is used often enough and / or the function is small enough), and then you will have the instruction "shl reg, 1" - maybe.
Which instruction most quickly relates to how they are implemented in the processor. Shl may not be the best choice, as it affects the flags C and Z, which slow it down. A few years ago, the recommendation was "lea reg, [reg + reg]" (all registers are the same), because lea did not affect any flags, and there were options like (using the eax register on the x86-32 platform as an example) :
lea eax,[eax+eax] ; *2 lea eax,[eax+eax*2] ; *3 lea eax,[eax+eax*4] ; *5 lea eax,[eax+eax*8] ; *9
I donβt know what the norm is today, but probably your compiler.
As for measuring information retrieval here, in the rdtsc command, which is the best alternative for picking up the handset when it counts the actual clock cycles.