---
name: "usb_calc_bus_time"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/usb_calc_bus_time"
---

# usb\_calc\_bus\_time(9)

approximate periodic transaction time in nanoseconds

## NAME

usb\_calc\_bus\_time - approximate periodic transaction time in nanoseconds

## SYNOPSIS

**long usb\_calc\_bus\_time(int** *speed***, int** *is\_input***, int** *isoc***, int** *bytecount***);**

## ARGUMENTS

*speed*

from dev-\>speed; USB\_SPEED\_{LOW,FULL,HIGH}

*is\_input*

true iff the transaction sends data to the host

*isoc*

true for isochronous transactions, false for interrupt ones

*bytecount*

how many bytes in the transaction.

## RETURN

Approximate bus time in nanoseconds for a periodic transaction.

## NOTE

See USB 2.0 spec section 5.11.3; only periodic transfers need to be scheduled in software, this function is only used for such scheduling.

## COPYRIGHT
