Duration of action of a drug depends upon its minimum effective concentration in the plasma and you can calculate it from the drug concentration administered and its elimination half life. Although onset of action depends upon the route of administration.
While PK parameters such as drug blood/plasma concentration-time noted above are essential, I would think "duration of action" is a pharmacodynamic question, i.e., at what concentration does the drug initiate and cease a measurable biological effect on the model or patient.
In principle PK (drug concentrations) drives PD (drug effects). The relationship between the two PK/PD can be more or less complex. You may be interested in the following article:
Gabrielsson et al 2010, J Pharmacol Toxicol Methods (2010), 61(2), 146-156: Optimising in vivo pharmacology studies—Practical PKPD considerations
I work with drugs for ADHD where you want early onset after taking drug in the morning and a duration that covers most of the active work or school day including after-work or after-school activities. Duration is based on a repeated measures analysis of the efficacy endpoint. Onset of clinical effect is defined as the earliest post-dose time point at which the difference between Test and Placebo is statistically significant. Duration is the time interval during which all differences are statistically significant.