Performance and Asynchronous Processing
A feature that optimizes the conversion process by enabling background operations and asynchronous execution, ensuring that number-to-word conversions do not block the main application thread.
Overview
Key Points
Aspect
Description
Code Example
// Initialize the control for asynchronous processing
var humanizer = new SiticoneHumanizerInt();
// Enable asynchronous processing for conversions
humanizer.EnableAsync = true;
// Set a custom timeout for asynchronous operations (e.g., 3000 milliseconds)
humanizer.AsyncTimeout = 3000;
// Asynchronously convert a number to words
async Task PerformAsyncConversion()
{
try
{
string result = await humanizer.NumberToWordsAsync(123456);
Console.WriteLine("Asynchronous conversion result: " + result);
}
catch (TimeoutException ex)
{
Console.WriteLine("Async conversion timed out: " + ex.Message);
}
catch (Exception ex)
{
Console.WriteLine("Error during async conversion: " + ex.Message);
}
}Best Practices
Practice
Recommendation
Code Example
Common Pitfalls
Pitfall
Explanation
Code Example
Usage Scenarios
Scenario
How It Works
Code Example
Real Life Usage Scenarios
Scenario
Explanation
Code Example
Troubleshooting Tips
Tip
Details
Code Example
Review
Aspect
Consideration
Summary
Summary Point
Description
Final Integration Example
Last updated