user79678: I set the fuses of my attiny85 so it uses the internal 128khz clock, prescaled so it is 16kHz.
I set the CKOUT fuse too so I can check the clock using an oscilloscope on pin 3 and yes it is 16kHz.
Now my problem is I have no option in the Arduino IDE to compile my code for 16kHz clock speed.
The slowest I have is 128khz, which causes the "blink" sketch to run for 8 seconds up, 8 seconds low on my attiny instead of 1 second.
I tried with "attiny" from David A. Mellis using https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json (Slowest : 1Mhz) and "ATTinyCore" from Spence Konde using http://drazzy.com/package_drazzy.com_index.json (Slowest : 128khz).
Does someone know how I can set my Arduino IDE to compile the code for an attiny85 using the 16khz internal clock ?
(Please, no question "why use a 16khz clock ?". The point is, this chip may be set to 16khz clock, so it should be possible to program it to use such clock speed)
Thank you.

user30175: The Arduino core you've referenced (and pretty much all other AVR Arduino cores too) specify the clock frequency that a particular selected board is running at in the boards.txt file. The platform.txt file then retrieves that value and creates the F_CPU macro with the clock frequency in hertz as a value.
For the ATTinyCore by Spence Konde, the ATTiny85 board definition is the attinyx5 section. There, you can either add a new clock selection menu item or modify the settings of an existing one, e.g.
https://github.com/SpenceKonde/ATTinyCore/blob/f5eabc8fb97e8fd72f1782a5e97345729e42ec47/avr/boards.txt#L409-L412
attinyx5.menu.clock.128internal=128 kHz (internal WDT)
attinyx5.menu.clock.128internal.bootloader.low_fuses=0xC4
attinyx5.menu.clock.128internal.build.f_cpu=128000L
attinyx5.menu.clock.128internal.build.clocksource=3

The file is locally under C:\Users\<user>\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.5.2.
There, f_cpu should be modified to 16000L for 16KHz, the low_fuses (lfuse) setting should be set to 0x24 and the text "128 kHz" should be adapted too. This is working per the comment on the question.
On a final note, you should create an issue at the core's repo to have a 16kHz added by default.
Also, you might find it easier to work with PlatformIO (+VSCode) instead of the Arduino IDE. A getting started page is here. In PlatformIO, instead of having to modify the internal boards.txt file, you can create a project configuration file (platformio.ini) in which you specify the same thing setting.
[env:attiny85]
platform = atmelavr
board = attiny85
framework = arduino
board_build.f_cpu = 16000L
; for upload settings, see 
; https://docs.platformio.org/en/latest/platforms/atmelavr.html#upload-using-programmer


79678: <p>I set the fuses of my attiny85 so it uses the internal 128khz clock, prescaled so it is 16kHz.
I set the CKOUT fuse too so I can check the clock using an oscilloscope on pin 3 and yes it is 16kHz.</p>
<p>Now my problem is I have no option in the Arduino IDE to compile my code for 16kHz clock speed.
The slowest I have is 128khz, which causes the &quot;blink&quot; sketch to run for 8 seconds up, 8 seconds low on my attiny instead of 1 second.</p>
<p>I tried with &quot;attiny&quot; from David A. Mellis using <a href="https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json" rel="nofollow noreferrer">https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json</a> (Slowest : 1Mhz) and &quot;ATTinyCore&quot; from Spence Konde using <a href="http://drazzy.com/package_drazzy.com_index.json" rel="nofollow noreferrer">http://drazzy.com/package_drazzy.com_index.json</a> (Slowest : 128khz).</p>
<p>Does someone know how I can set my Arduino IDE to compile the code for an attiny85 using the 16khz internal clock ?</p>
<p>(Please, no question &quot;why use a 16khz clock ?&quot;. The point is, this chip may be set to 16khz clock, so it should be possible to program it to use such clock speed)</p>
<p>Thank you.</p>
 30175: <p>The Arduino core you've referenced (and pretty much all other AVR Arduino cores too) specify the clock frequency that a particular selected board is running at in the <code>boards.txt</code> file. The <code>platform.txt</code> file then retrieves that value and creates the <code>F_CPU</code> macro with the clock frequency in hertz as a value.</p>
<p>For the ATTinyCore by Spence Konde, the ATTiny85 board definition is the <code>attinyx5</code> section. There, you can either add a new clock selection menu item or modify the settings of an existing one, e.g.</p>
<p><a href="https://github.com/SpenceKonde/ATTinyCore/blob/f5eabc8fb97e8fd72f1782a5e97345729e42ec47/avr/boards.txt#L409-L412" rel="nofollow noreferrer">https://github.com/SpenceKonde/ATTinyCore/blob/f5eabc8fb97e8fd72f1782a5e97345729e42ec47/avr/boards.txt#L409-L412</a></p>
<pre><code>attinyx5.menu.clock.128internal=128 kHz (internal WDT)
attinyx5.menu.clock.128internal.bootloader.low_fuses=0xC4
attinyx5.menu.clock.128internal.build.f_cpu=128000L
attinyx5.menu.clock.128internal.build.clocksource=3
</code></pre>
<p>The file is locally under <code>C:\Users\&lt;user&gt;\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.5.2</code>.</p>
<p>There, <code>f_cpu</code> should be modified to <code>16000L</code> for 16KHz, the <code>low_fuses</code> (lfuse) setting should be set to <code>0x24</code> and the text &quot;128 kHz&quot; should be adapted too. This is working per the comment on the question.</p>
<p>On a final note, you should create an issue at the core's repo to have a 16kHz added by default.</p>
<p>Also, you might find it easier to work with PlatformIO (+VSCode) instead of the Arduino IDE. A getting started page is <a href="https://docs.platformio.org/en/latest/integration/ide/vscode.html#installation" rel="nofollow noreferrer">here</a>. In PlatformIO, instead of having to modify the internal <code>boards.txt</code> file, you can create a project configuration file (<code>platformio.ini</code>) in which you specify the same thing setting.</p>
<pre><code>[env:attiny85]
platform = atmelavr
board = attiny85
framework = arduino
board_build.f_cpu = 16000L
; for upload settings, see 
; https://docs.platformio.org/en/latest/platforms/atmelavr.html#upload-using-programmer
</code></pre>
