Like the blue enhanced photodiode from Applied Sensors, light emitting diodes (LEDs) also conduct current at different rates with different levels of light exposure. Since the currents are very small for ambient light levels, it turns out that the stray capacitance in the I/O pin, the metal clip under the breadboard row, and the LED's silicon junction store enough charge to make the RCTIME measurement work. Try the attached circuit and code under controlled conditions.