Officers and warrant officers on active duty in the service of the State shall receive the same pay and allowances as officers of similar grade in the United States Army, United States Air Force and United States Navy. All full time active duty heretofore or hereafter performed in the service of the State shall be credited for purposes of determining longevity and service within the provisions of this section and Section 340 of this code.