-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Now you can stop searching after pause. Added some simple code fixes
- Loading branch information
Showing
3 changed files
with
76 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System; | ||
|
||
namespace SimpleFullTextSearcher.Extensions | ||
{ | ||
/// <summary> | ||
/// Методы расширения для типа long | ||
/// </summary> | ||
public static class LongExtension | ||
{ | ||
/// <summary> | ||
/// Переводит значение миллисекунд типа long в строковое представление, содержащее дни, часы, минуты, секунды и миллесекунды | ||
/// </summary> | ||
/// <param name="l">Значение в миллисекундах</param> | ||
/// <returns>Возвращает значение в виде строки, представляющей полное время (в днях, часах, минутах, секундах и миллесекундах) из миллисекунд</returns> | ||
public static string MillisecondsToTimeString(this long l) | ||
{ | ||
var ts = new TimeSpan(0, 0, 0, 0, Convert.ToInt32(l)); | ||
return $"{ts.Days} д, {ts.Hours} ч, {ts.Minutes} м, {ts.Seconds} с, {ts.Milliseconds} мс"; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters