Looping is one of the fundamental logical instructions used for repeating a block of statements. All programming languages are used looping structures to simplify the programs. Loops are supported by all modern programming languages, though their implementations and syntax may differ. This paper compares the two types of looping structures while and do-while using the compile time and runtime of the given programs to improve the efficiency of the programs. It is found that for small number of iterations while is efficient in runtime and do-while is efficient in compile time, the difference in total execution time may not be considerable. But given any large number of iterations, the difference is noticeable.