# Delay on Raspi about 58 us and 100 us

Does anyone know how to make delay on raspberry pi until 58 us and 100 us? I am using raspberry pi 4B with python language. I want to make code for sending packet data (I will include my code). I'm currently using time.sleep() to determine where is bit 1 and bit 0, but unfortunately, this can't handle period until 58us and 100us. I want to make bit 1 with length 58us high and 58us low (116us/period) and bit 0 with length 100us high and 100us low (200us/period) Please help me Thank you

import pigpio
import time

PIN_12 = 12
PIN_13 = 13
BIT_TIMINGS = [100, 58]

class Packet:
def __init__(self):
self.address = [0, 0, 0, 0, 0, 0, 1, 1]
self.command = [0, 1, 1, 0, 1, 1, 1, 1]
self.EOR = [0, 0, 0, 0, 0, 0, 0, 0]

def setup():
global pi
pi = pigpio.pi()  # Connect to the local Pi

pi.set_mode(PIN_12, pigpio.OUTPUT)
pi.set_mode(PIN_13, pigpio.OUTPUT)

pi.write(PIN_12, 1)  # Set initial state
pi.write(PIN_13, 0)  # Set initial state

EOR(train)
idle_packet(100)

def loop():
go_straight(train)
idle_packet(2)

def EOR(train):
train.EOR = [a ^ b for a, b in zip(train.address, train.command)]

def output_bit(bit_val, pin):
pi.write(pin, 1)
time.sleep(BIT_TIMINGS[bit_val] / 1000000.0)
pi.write(pin, 0)
time.sleep(BIT_TIMINGS[bit_val] / 1000000.0)

def go_straight(train):
for _ in range(12):
output_bit(1, PIN_13)
output_bit(0, PIN_13)

output_bit(bit, PIN_12)
output_bit(0, PIN_12)

for bit in train.command:
output_bit(bit, PIN_12)
output_bit(0, PIN_12)

for bit in train.EOR:
output_bit(bit, PIN_12)
output_bit(1, PIN_12)

def idle_packet(how_many):
for _ in range(how_many):
for _ in range(12):
output_bit(1, PIN_13)
output_bit(0, PIN_13)

for _ in range(8):
output_bit(1, PIN_12)
output_bit(0, PIN_12)

for _ in range(8):
output_bit(0, PIN_12)
output_bit(0, PIN_12)

for _ in range(8):
output_bit(1, PIN_12)
output_bit(1, PIN_12)

try:
train = Packet()
setup()

while True:
loop()

except KeyboardInterrupt:
pi.stop()  # Cleanup pigpio resources