# Percentage of Time

> Enable features for a percentage of time.

Use Cases:
* load testing new features behind the scenes
* Performing random sampling of metrics that are too expensive to collect for all requests

Do not use percentage of time for slowly rolling out new features. It will return a different result on subsequent calls by the same actor, which will be an inconsistent experience for the user. Use [percentage of actors](percentage-of-actors) instead.

###### Percentage of Time Example

```ruby
user = User.find(...)

Flipper.enable_percentage_of_time(:dark_ship_new_feature, 25)

# returns true for ~25% of the enabled? calls irregardless of the actor provided
Flipper.enabled?(:dark_ship_new_feature)
Flipper.enabled?(:dark_ship_new_feature, user)
```

## Caveats

Percentage of time is not a good idea for enabling new features in a UI. Most often you'll use percentage of actors, but there are definitely times when I have found percentage of time to be very useful.
