Question: Is it possible to change the length of time a toast is displayed different from the ~7 second default?
Answer: Not programmatically. Toast display time is user-controlled via PC Settings > Ease of Access > Other Options > “Show notifications for” (for Windows 8.1; leave out Other Options on Windows 8). It’s one place where the user is in control, because different users respond at widely different speeds. You cannot assume that 2 seconds, for example, is long enough. A user might have difficulty reading, for example, or might have difficulty placing a mouse cursor or touching the screen fast enough to respond to the toast (think of a paralyzed user who is tapping keys with a mouth rod).
The shortest it can be set is 5 seconds, the longest 5 minutes. If you have some UX requirement that requires a shorter time (e.g. you’re trying to display short transient messages within a running app), then you should think about a different mechanism such as one using in-app flyouts.